deeksonparlma
commited on
Commit
·
4e8eb95
1
Parent(s):
291e47a
fix run out of data error
Browse files- app.py +0 -4
- data_train.csv +0 -0
- model.ipynb +9 -84
app.py
CHANGED
|
@@ -87,12 +87,8 @@ with open("intents.json") as file:
|
|
| 87 |
data = json.load(file)
|
| 88 |
|
| 89 |
with open("data.pickle", "rb") as f:
|
| 90 |
-
data = pd.read_pickle(f)
|
| 91 |
words, labels, training, output = pickle.load(f)
|
| 92 |
|
| 93 |
-
df = pd.DataFrame(data)
|
| 94 |
-
df.to_csv('data_train.csv', index=False)
|
| 95 |
-
|
| 96 |
net = tflearn.input_data(shape=[None, len(training[0])])
|
| 97 |
net = tflearn.fully_connected(net, 8)
|
| 98 |
net = tflearn.fully_connected(net, 8)
|
|
|
|
| 87 |
data = json.load(file)
|
| 88 |
|
| 89 |
with open("data.pickle", "rb") as f:
|
|
|
|
| 90 |
words, labels, training, output = pickle.load(f)
|
| 91 |
|
|
|
|
|
|
|
|
|
|
| 92 |
net = tflearn.input_data(shape=[None, len(training[0])])
|
| 93 |
net = tflearn.fully_connected(net, 8)
|
| 94 |
net = tflearn.fully_connected(net, 8)
|
data_train.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.ipynb
CHANGED
|
@@ -5,89 +5,7 @@
|
|
| 5 |
"execution_count": 2,
|
| 6 |
"id": "ace57031",
|
| 7 |
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"data": {
|
| 11 |
-
"text/html": [
|
| 12 |
-
"<div>\n",
|
| 13 |
-
"<style scoped>\n",
|
| 14 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 15 |
-
" vertical-align: middle;\n",
|
| 16 |
-
" }\n",
|
| 17 |
-
"\n",
|
| 18 |
-
" .dataframe tbody tr th {\n",
|
| 19 |
-
" vertical-align: top;\n",
|
| 20 |
-
" }\n",
|
| 21 |
-
"\n",
|
| 22 |
-
" .dataframe thead th {\n",
|
| 23 |
-
" text-align: right;\n",
|
| 24 |
-
" }\n",
|
| 25 |
-
"</style>\n",
|
| 26 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 27 |
-
" <thead>\n",
|
| 28 |
-
" <tr style=\"text-align: right;\">\n",
|
| 29 |
-
" <th></th>\n",
|
| 30 |
-
" <th>Question_ID</th>\n",
|
| 31 |
-
" <th>Questions</th>\n",
|
| 32 |
-
" <th>Answers</th>\n",
|
| 33 |
-
" </tr>\n",
|
| 34 |
-
" </thead>\n",
|
| 35 |
-
" <tbody>\n",
|
| 36 |
-
" <tr>\n",
|
| 37 |
-
" <th>0</th>\n",
|
| 38 |
-
" <td>1590140</td>\n",
|
| 39 |
-
" <td>What does it mean to have a mental illness?</td>\n",
|
| 40 |
-
" <td>Mental illnesses are health conditions that di...</td>\n",
|
| 41 |
-
" </tr>\n",
|
| 42 |
-
" <tr>\n",
|
| 43 |
-
" <th>1</th>\n",
|
| 44 |
-
" <td>2110618</td>\n",
|
| 45 |
-
" <td>Who does mental illness affect?</td>\n",
|
| 46 |
-
" <td>It is estimated that mental illness affects 1 ...</td>\n",
|
| 47 |
-
" </tr>\n",
|
| 48 |
-
" <tr>\n",
|
| 49 |
-
" <th>2</th>\n",
|
| 50 |
-
" <td>6361820</td>\n",
|
| 51 |
-
" <td>What causes mental illness?</td>\n",
|
| 52 |
-
" <td>It is estimated that mental illness affects 1 ...</td>\n",
|
| 53 |
-
" </tr>\n",
|
| 54 |
-
" <tr>\n",
|
| 55 |
-
" <th>3</th>\n",
|
| 56 |
-
" <td>9434130</td>\n",
|
| 57 |
-
" <td>What are some of the warning signs of mental i...</td>\n",
|
| 58 |
-
" <td>Symptoms of mental health disorders vary depen...</td>\n",
|
| 59 |
-
" </tr>\n",
|
| 60 |
-
" <tr>\n",
|
| 61 |
-
" <th>4</th>\n",
|
| 62 |
-
" <td>7657263</td>\n",
|
| 63 |
-
" <td>Can people with mental illness recover?</td>\n",
|
| 64 |
-
" <td>When healing from mental illness, early identi...</td>\n",
|
| 65 |
-
" </tr>\n",
|
| 66 |
-
" </tbody>\n",
|
| 67 |
-
"</table>\n",
|
| 68 |
-
"</div>"
|
| 69 |
-
],
|
| 70 |
-
"text/plain": [
|
| 71 |
-
" Question_ID Questions \\\n",
|
| 72 |
-
"0 1590140 What does it mean to have a mental illness? \n",
|
| 73 |
-
"1 2110618 Who does mental illness affect? \n",
|
| 74 |
-
"2 6361820 What causes mental illness? \n",
|
| 75 |
-
"3 9434130 What are some of the warning signs of mental i... \n",
|
| 76 |
-
"4 7657263 Can people with mental illness recover? \n",
|
| 77 |
-
"\n",
|
| 78 |
-
" Answers \n",
|
| 79 |
-
"0 Mental illnesses are health conditions that di... \n",
|
| 80 |
-
"1 It is estimated that mental illness affects 1 ... \n",
|
| 81 |
-
"2 It is estimated that mental illness affects 1 ... \n",
|
| 82 |
-
"3 Symptoms of mental health disorders vary depen... \n",
|
| 83 |
-
"4 When healing from mental illness, early identi... "
|
| 84 |
-
]
|
| 85 |
-
},
|
| 86 |
-
"execution_count": 2,
|
| 87 |
-
"metadata": {},
|
| 88 |
-
"output_type": "execute_result"
|
| 89 |
-
}
|
| 90 |
-
],
|
| 91 |
"source": [
|
| 92 |
"from sklearn.feature_extraction.text import TfidfVectorizer\n",
|
| 93 |
"from sklearn.model_selection import train_test_split\n",
|
|
@@ -127,7 +45,14 @@
|
|
| 127 |
" pass\n",
|
| 128 |
"\n",
|
| 129 |
"data = pd.read_csv(\"data.csv\")\n",
|
| 130 |
-
"data.head()"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
]
|
| 132 |
},
|
| 133 |
{
|
|
|
|
| 5 |
"execution_count": 2,
|
| 6 |
"id": "ace57031",
|
| 7 |
"metadata": {},
|
| 8 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"source": [
|
| 10 |
"from sklearn.feature_extraction.text import TfidfVectorizer\n",
|
| 11 |
"from sklearn.model_selection import train_test_split\n",
|
|
|
|
| 45 |
" pass\n",
|
| 46 |
"\n",
|
| 47 |
"data = pd.read_csv(\"data.csv\")\n",
|
| 48 |
+
"data.head()\n",
|
| 49 |
+
"\n",
|
| 50 |
+
"with open(\"data.pickle\", \"rb\") as f:\n",
|
| 51 |
+
" data = pd.read_pickle(f)\n",
|
| 52 |
+
"# words, labels, training, output = pickle.load(f)\n",
|
| 53 |
+
"\n",
|
| 54 |
+
"df = pd.DataFrame(data)\n",
|
| 55 |
+
"df.to_csv('data_train.csv', index=False)"
|
| 56 |
]
|
| 57 |
},
|
| 58 |
{
|