Spaces:
Running
Running
no qual score summing. truly random samples
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import transformers as tf
|
3 |
import pandas as pd
|
|
|
4 |
from plotly import graph_objects as go
|
5 |
|
6 |
from overview import NQDOverview
|
@@ -70,7 +71,7 @@ lc_placeholder.empty()
|
|
70 |
examples = load_pickle('test.pkl')
|
71 |
|
72 |
### Process input
|
73 |
-
ex = examples['comment'].sample(1).tolist()[0]
|
74 |
try:
|
75 |
ex = ex.strip().replace('_x000D_', '').replace('nan', 'blank')
|
76 |
except:
|
@@ -94,9 +95,9 @@ with st.form('comment_form'):
|
|
94 |
|
95 |
results = run_models(models_to_load, models, st.session_state['comment'])
|
96 |
# Modify results to sum the QuAL score and to ignore Q3 if Q2 no suggestion
|
97 |
-
if results['q2i']['label'] == 1:
|
98 |
-
results['q3i']['label'] = 1 # can't have connection if no suggestion
|
99 |
-
results['qual']['label'] = results['q1']['label'] + (not results['q2i']['label']) + (not results['q3i']['label'])
|
100 |
|
101 |
overview = NQDOverview(st, results)
|
102 |
overview.draw()
|
|
|
1 |
import streamlit as st
|
2 |
import transformers as tf
|
3 |
import pandas as pd
|
4 |
+
from datetime import datetime
|
5 |
from plotly import graph_objects as go
|
6 |
|
7 |
from overview import NQDOverview
|
|
|
71 |
examples = load_pickle('test.pkl')
|
72 |
|
73 |
### Process input
|
74 |
+
ex = examples['comment'].sample(1, random_state=int(datetime.now().timestamp())).tolist()[0]
|
75 |
try:
|
76 |
ex = ex.strip().replace('_x000D_', '').replace('nan', 'blank')
|
77 |
except:
|
|
|
95 |
|
96 |
results = run_models(models_to_load, models, st.session_state['comment'])
|
97 |
# Modify results to sum the QuAL score and to ignore Q3 if Q2 no suggestion
|
98 |
+
# if results['q2i']['label'] == 1:
|
99 |
+
# results['q3i']['label'] = 1 # can't have connection if no suggestion
|
100 |
+
# results['qual']['label'] = results['q1']['label'] + (not results['q2i']['label']) + (not results['q3i']['label'])
|
101 |
|
102 |
overview = NQDOverview(st, results)
|
103 |
overview.draw()
|