Tinny-Robot Gideon Onyewuenyi commited on
Commit
8da5c36
·
0 Parent(s):

Duplicate from gideononyewuenyi/Question-Answer-Demo

Browse files

Co-authored-by: Gideon Onyewuenyi <[email protected]>

Files changed (4) hide show
  1. .gitattributes +28 -0
  2. README.md +14 -0
  3. app.py +24 -0
  4. requirements.txt +2 -0
.gitattributes ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.wasm filter=lfs diff=lfs merge=lfs -text
25
+ *.xz filter=lfs diff=lfs merge=lfs -text
26
+ *.zip filter=lfs diff=lfs merge=lfs -text
27
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
28
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Question Answer Demo
3
+ emoji: 👁
4
+ colorFrom: pink
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: 2.9.1
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ duplicated_from: gideononyewuenyi/Question-Answer-Demo
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """Thera _QA.ipynb
3
+
4
+ Automatically generated by Colaboratory.
5
+
6
+ Original file is located at
7
+ https://colab.research.google.com/drive/1OhlAM33IIUg46ntfmrsQqQlIyCJGMi0k
8
+ """
9
+
10
+ import gradio as gr
11
+ from transformers import pipeline
12
+
13
+
14
+ context = "Mental health is a state of well being in which the individual realizes his or her own abilities can cope with the normal stresses of life can work productively and fruitfully and is able to make a contribution to his or her community according to the World Health Organization Mental health includes subjective well being perceived self efficacy autonomy competence intergenerational dependence and self actualization of ones intellectual and emotional potential among others From the perspectives of positive psychology or holism mental health may include an individuals ability to enjoy life and to create a balance between life activities and efforts to achieve psychological resilience Cultural differences subjective assessments and competing professional theories all affect how one defines Some early signrelated to mental health problems are sleep irritation lack of energy and thinking of harming yourself or others"
15
+ question = "What are the mental health problems?"
16
+
17
+
18
+ question_answerer = pipeline("question-answering", model = "distilbert-base-cased-distilled-squad")
19
+
20
+
21
+ interface = gr.Interface.from_pipeline(question_answerer,
22
+ title = "question & answering demo on mental health",
23
+ theme = "peach",
24
+ examples = [[context, question]]).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ tensorflow
2
+ transformers