res model, dict fix
Browse files- .gitignore +1 -0
- app.py +2 -2
.gitignore
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
results/**
|
2 |
data/**
|
|
|
|
1 |
results/**
|
2 |
data/**
|
3 |
+
res/**
|
app.py
CHANGED
@@ -11,7 +11,7 @@ def analyze(input, model):
|
|
11 |
return "This is a sample output"
|
12 |
|
13 |
# load my fine-tuned model
|
14 |
-
fine_tuned = "
|
15 |
labels = {'LABEL_0': 'toxic', 'LABEL_1': 'severe_toxic', 'LABEL_2': 'obscene', 'LABEL_3': 'threat',
|
16 |
'LABEL_4': 'insult', 'LABEL_5': 'identity_hate'}
|
17 |
|
@@ -56,7 +56,7 @@ if st.button('Analyze'):
|
|
56 |
output.append(['Tweet', 'Highest', 'Score', 'Second Highest', 'Score'])
|
57 |
highest = (max(result, key=result.get), result[max(result, key=result.get)])
|
58 |
result.pop(max(result, key=result.get))
|
59 |
-
output.append([input, max(result, highest[0], highest[1],
|
60 |
st.table(output)
|
61 |
else:
|
62 |
output = result
|
|
|
11 |
return "This is a sample output"
|
12 |
|
13 |
# load my fine-tuned model
|
14 |
+
fine_tuned = "res"
|
15 |
labels = {'LABEL_0': 'toxic', 'LABEL_1': 'severe_toxic', 'LABEL_2': 'obscene', 'LABEL_3': 'threat',
|
16 |
'LABEL_4': 'insult', 'LABEL_5': 'identity_hate'}
|
17 |
|
|
|
56 |
output.append(['Tweet', 'Highest', 'Score', 'Second Highest', 'Score'])
|
57 |
highest = (max(result, key=result.get), result[max(result, key=result.get)])
|
58 |
result.pop(max(result, key=result.get))
|
59 |
+
output.append([input, max(result, key=result.get), highest[0], highest[1], result[max(result, key=result.get)]])
|
60 |
st.table(output)
|
61 |
else:
|
62 |
output = result
|