maxspad commited on
Commit
1bb3e7f
1 Parent(s): d69173c

prep for final revisions for paper

Browse files
Files changed (3) hide show
  1. TODO.md +20 -0
  2. fullreport.py +43 -12
  3. plots.py +14 -1
TODO.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - Level of detail = description of context and performance
2
+ - Suggestion for "improvement" given
3
+ - "written" feedback
4
+ - Link
5
+ - How specific was the evaluator in describing the behavior? => exact language of Q1
6
+ - get rid of overall model just use component model
7
+ - get rid of true comments
8
+
9
+ - Medical education requires high-quality *written* feedback, but evaluating these *supervisor narrative comments* is time-consuming. The QuAL score has validity evidence for measuring the quality of short comments in this context. We developed a NLP/ML-powered tool to assess written comment quality via the QuAL score with high accuracy. Try it for yourself!
10
+
11
+ - include confidence bar
12
+
13
+ - change out to formal descriptions
14
+
15
+ # Paper
16
+ - zotero refs
17
+ - methods comments
18
+ - flowchart figure
19
+ - final word clouds
20
+ - add within-1 accuracy numbers
fullreport.py CHANGED
@@ -1,7 +1,8 @@
1
  import streamlit as st
2
  import altair as alt
3
  import pandas as pd
4
- from plots import altair_gauge
 
5
 
6
  md_about_qual = '''
7
  The Quality of Assessment for Learning (QuAL) score measures three
@@ -27,19 +28,49 @@ class NQDFullReport(object):
27
  # with st.expander('About the QuAL Score', True):
28
  st.markdown(md_about_qual)
29
 
30
- st.subheader('Your Level of Detail')
31
-
32
- gauge = altair_gauge(self.results['q1']['label'], 3, 'Level of Detail')
33
  c1, c2 = st.columns(2)
34
  with c1:
 
 
 
35
  st.altair_chart(gauge, use_container_width=True)
36
  with c2:
37
- # st.write(self.results)
38
- bar_df = (pd.DataFrame(self.results['q1']['scores'])
39
- .reset_index()
40
- .rename(columns={'index': 'Rating', 0: 'Score'}))
41
- bar = alt.Chart(bar_df).mark_bar().encode(
42
- x='Rating:O', y='Score',
43
- color=alt.Color('Rating', scale=alt.Scale(scheme='redyellowgreen'), legend=None)
44
- ).properties(height=225, title='Prediction Scores')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  st.altair_chart(bar, use_container_width=True)
 
1
  import streamlit as st
2
  import altair as alt
3
  import pandas as pd
4
+ from plots import altair_gauge, pred_bar_chart
5
+ import streamlit.components.v1 as components
6
 
7
  md_about_qual = '''
8
  The Quality of Assessment for Learning (QuAL) score measures three
 
28
  # with st.expander('About the QuAL Score', True):
29
  st.markdown(md_about_qual)
30
 
31
+ st.subheader('Level of Detail')
 
 
32
  c1, c2 = st.columns(2)
33
  with c1:
34
+ gauge = altair_gauge(self.results['q1']['label'], 3, 'Level of Detail')
35
+ gauge_html = gauge.to_html()
36
+ # components.html(gauge_html, height=225, width=334)
37
  st.altair_chart(gauge, use_container_width=True)
38
  with c2:
39
+ bar = pred_bar_chart(self.results['q1']['scores'])
40
+ st.altair_chart(bar, use_container_width=True)
41
+
42
+ st.subheader('Suggestion for Improvement')
43
+ c1, c2 = st.columns(2)
44
+ with c1:
45
+ q2lab = self.results['q2i']['label']
46
+ st.markdown('#### Suggestion Given')
47
+ if q2lab == 0:
48
+ md_str = '# ✅ Yes'
49
+ else:
50
+ md_str = '# ❌ No'
51
+ st.markdown(md_str)
52
+ # st.metric('Suggestion Given', (md_str),
53
+ # help='Did the evaluator give a suggestion for improvement?')
54
+ gauge = altair_gauge(self.results['q2i']['label'], 1, 'Suggestion for Improvement')
55
+ # st.altair_chart(gauge, use_container_width=True)
56
+ with c2:
57
+ bar = pred_bar_chart(self.results['q2i']['scores'], binary_labels={0: 'Yes', 1: 'No'})
58
+ st.altair_chart(bar, use_container_width=True)
59
+
60
+ st.subheader('Suggestion Linking')
61
+ c1, c2 = st.columns(2)
62
+ with c1:
63
+ q2lab = self.results['q3i']['label']
64
+ st.markdown('#### Suggestion Linked')
65
+ if q2lab == 0:
66
+ md_str = '# ✅ Yes'
67
+ else:
68
+ md_str = '# ❌ No'
69
+ st.markdown(md_str)
70
+ # st.metric('Suggestion Given', (md_str),
71
+ # help='Did the evaluator give a suggestion for improvement?')
72
+ gauge = altair_gauge(self.results['q3i']['label'], 1, 'Suggestion for Improvement')
73
+ # st.altair_chart(gauge, use_container_width=True)
74
+ with c2:
75
+ bar = pred_bar_chart(self.results['q3i']['scores'], binary_labels={0: 'Yes', 1: 'No'})
76
  st.altair_chart(bar, use_container_width=True)
plots.py CHANGED
@@ -16,4 +16,17 @@ def get_color(score, max_score):
16
  cmap = cm.get_cmap('RdYlGn')
17
  color = cmap(score / float(max_score))
18
  color = f'rgba({int(color[0]*256)}, {int(color[1]*256)}, {int(color[2]*256)}, {int(color[3]*256)})'
19
- return color
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  cmap = cm.get_cmap('RdYlGn')
17
  color = cmap(score / float(max_score))
18
  color = f'rgba({int(color[0]*256)}, {int(color[1]*256)}, {int(color[2]*256)}, {int(color[3]*256)})'
19
+ return color
20
+
21
+ def pred_bar_chart(scores, binary_labels=None):
22
+ bar_df = (pd.DataFrame(scores)
23
+ .reset_index()
24
+ .rename(columns={'index': 'Rating', 0: 'Score'}))
25
+ if binary_labels:
26
+ bar_df['Rating'].replace(binary_labels, inplace=True)
27
+ bar = alt.Chart(bar_df).mark_bar().encode(
28
+ x='Rating:O', y='Score',
29
+ color=alt.Color('Rating', scale=alt.Scale(scheme='redyellowgreen'), legend=None)
30
+ ).properties(height=225, title='Prediction Scores')
31
+ bar.to_html()
32
+ return bar