Shadifatemi commited on
Commit
e8892c1
1 Parent(s): cff53b7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ # Define the prompt for self-assessment
4
+ prompt = "Please answer the following questions to assess your ADHD symptoms:\n"
5
+
6
+ # Define the questions for self-assessment
7
+ questions = [
8
+ "Do you often struggle with paying attention to details or making careless mistakes in your work or daily activities?",
9
+ "Do you find it difficult to sustain focus on tasks or activities, especially if they are not highly stimulating or interesting to you?",
10
+ "Are you frequently forgetful in your daily life, such as forgetting appointments, deadlines, or where you put your belongings?",
11
+ "Do you often have trouble organizing tasks and activities, such as prioritizing tasks or managing your time effectively?",
12
+ "Do you frequently feel restless or have difficulty staying seated in situations where it is expected, such as in meetings or during conversations?",
13
+ "Are you easily distracted by external stimuli or unrelated thoughts during conversations, work, or leisure activities?",
14
+ "Do you often struggle with following through on instructions or completing tasks, even when they are important or meaningful to you?",
15
+ "Do you frequently lose or misplace important items, such as keys, wallets, or phones?",
16
+ "Do you find it challenging to engage in activities that require sustained mental effort or attention, such as reading or studying?",
17
+ "Do you often feel overwhelmed or have difficulty managing multiple tasks or responsibilities at the same time?"
18
+ ]
19
+
20
+ # Initialize the Hugging Face pipeline for text generation
21
+ generator = pipeline("text-generation", model="EleutherAI/gpt-neo-1.3B")
22
+
23
+ # Generate the self-assessment
24
+ assessment = generator(prompt + "\n".join(questions), max_length=500, num_return_sequences=1, do_sample=True)[0]['generated_text']
25
+
26
+ # Print the self-assessment
27
+ print(assessment)