gdn commited on
Commit
9a48aae
1 Parent(s): bc1952c
Files changed (2) hide show
  1. app.py +24 -0
  2. requirements.txt +2 -0
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