Spaces:
Sleeping
Sleeping
fix_doc
Browse files
app.py
CHANGED
@@ -16,31 +16,31 @@ st.title("Sentiment Analysis App")
|
|
16 |
|
17 |
# Set the variables that should not be changed between refreshes of the app.
|
18 |
|
19 |
-
|
20 |
-
logs is a map that records the results of past sentiment analysis queries.
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
if 'logs' not in st.session_state:
|
45 |
st.session_state.logs = dict()
|
46 |
|
|
|
16 |
|
17 |
# Set the variables that should not be changed between refreshes of the app.
|
18 |
|
19 |
+
|
20 |
+
# logs is a map that records the results of past sentiment analysis queries.
|
21 |
+
# Type: dict() {"key" --> value[]}
|
22 |
+
# key: model_name (string) - The name of the model being used
|
23 |
+
# value: log[] (list) - The list of values that represent the model's results
|
24 |
+
# --> For the pretrained labels, len(log) = 4
|
25 |
+
# --> log[0] (int) - The prediction of the model on its input
|
26 |
+
# --> 0 = Positive
|
27 |
+
# --> 1 = Negative
|
28 |
+
# --> 2 = Neutral (if applicable)
|
29 |
+
# --> log[1] (string) - The tweet/inputted string
|
30 |
+
# --> log[2] (string) - The judgement of the tweet/input (Positive/Neutral/Negative)
|
31 |
+
# --> log[3] (string) - The score of the prediction (includes '%' sign)
|
32 |
+
# --> For the finetuned model, len(log) = 6
|
33 |
+
# --> log[0] (int) - The prediction of the model on the toxicity of the input
|
34 |
+
# --> 0 = Nontoxic
|
35 |
+
# --> 1 = Toxic
|
36 |
+
# --> log[1] (string) - The tweet/inputted string
|
37 |
+
# --> log[2] (string) - The highest scoring overall category of toxicity out of:
|
38 |
+
# 'toxic', 'severe_toxic', 'obscene', 'threat', 'insult', and 'identity_hate'
|
39 |
+
# --> log[3] (string) - The score of log[2] (includes '%' sign)
|
40 |
+
# --> log[4] (string) - The predicted type of toxicity, the highest scoring category of toxicity out of:
|
41 |
+
# 'obscene', 'threat', 'insult', and 'identity_hate'
|
42 |
+
# --> log[5] (string) - The score of log[4] (includes '%' sign)
|
43 |
+
|
44 |
if 'logs' not in st.session_state:
|
45 |
st.session_state.logs = dict()
|
46 |
|