Paula Leonova commited on
Commit
662dc37
1 Parent(s): e68a5f1

Add ground truth inputs

Browse files
Files changed (2) hide show
  1. app.py +7 -7
  2. examples.json +1 -1
app.py CHANGED
@@ -18,7 +18,8 @@ ex_long_text = example_long_text_load()
18
  st.header("Summzarization & Multi-label Classification for Long Text")
19
  st.write("This app summarizes and then classifies your long text with multiple labels.")
20
  st.write("__Inputs__: User enters their own custom text and labels.")
21
- st.write("__Outputs__: A summary of the text, label likelihood percentages and a downloadable csv of the results.")
 
22
 
23
  with st.form(key='my_form'):
24
  example_text = ex_long_text #ex_text
@@ -31,13 +32,12 @@ with st.form(key='my_form'):
31
  labels = st.text_input('Enter possible labels (comma-separated):',ex_labels, max_chars=1000)
32
  labels = list(set([x.strip() for x in labels.strip().split(',') if len(x.strip()) > 0]))
33
 
34
- radio = st.radio(
35
- "Are ground truth labels available?",
36
- ('No', 'Yes'))
37
 
38
- if radio == 'Yes':
39
- glabels = st.text_input('Enter known labels (comma-separated):',ex_glabels, max_chars=1000)
40
- glabels = list(set([x.strip() for x in glabels.strip().split(',') if len(x.strip()) > 0]))
41
 
42
  submit_button = st.form_submit_button(label='Submit')
43
 
 
18
  st.header("Summzarization & Multi-label Classification for Long Text")
19
  st.write("This app summarizes and then classifies your long text with multiple labels.")
20
  st.write("__Inputs__: User enters their own custom text and labels.")
21
+ st.write("__Outputs__: A summary of the text, likelihood percentages for each label and a downloadable csv of the results. \
22
+ Option to evaluate results against a list of ground truth labels, if available.")
23
 
24
  with st.form(key='my_form'):
25
  example_text = ex_long_text #ex_text
 
32
  labels = st.text_input('Enter possible labels (comma-separated):',ex_labels, max_chars=1000)
33
  labels = list(set([x.strip() for x in labels.strip().split(',') if len(x.strip()) > 0]))
34
 
35
+ glabels = st.text_input('If available, enter ground truth labels to evaluate results, otherwise leave blank (comma-separated):',ex_glabels, max_chars=1000)
36
+ glabels = list(set([x.strip() for x in glabels.strip().split(',') if len(x.strip()) > 0]))
 
37
 
38
+ threshold_value = st.slider(
39
+ 'Select a threshold cutoff for matching percentage (used for ground truth label evaluation)',
40
+ 0.0, 1.0, (0.5))
41
 
42
  submit_button = st.form_submit_button(label='Submit')
43
 
examples.json CHANGED
@@ -2,5 +2,5 @@
2
  "text": "Such were the professor’s words—rather let me say such the words of the fate—enounced to destroy me. As he went on I felt as if my soul were grappling with a palpable enemy; one by one the various keys were touched which formed the mechanism of my being; chord after chord was sounded, and soon my mind was filled with one thought, one conception, one purpose. So much has been done, exclaimed the soul of Frankenstein—more, far more, will I achieve; treading in the steps already marked, I will pioneer a new way, explore unknown powers, and unfold to the world the deepest mysteries of creation.",
3
  "long_text_license": "[This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook.]",
4
  "labels":"Batman,Science,Sound,Light,Creation,Optics,Eyes,Engineering,Color,Communication,Death",
5
- "ground_labels":"Science,Sound,Light,Creation,,Engineering,Communication,Death"
6
  }
 
2
  "text": "Such were the professor’s words—rather let me say such the words of the fate—enounced to destroy me. As he went on I felt as if my soul were grappling with a palpable enemy; one by one the various keys were touched which formed the mechanism of my being; chord after chord was sounded, and soon my mind was filled with one thought, one conception, one purpose. So much has been done, exclaimed the soul of Frankenstein—more, far more, will I achieve; treading in the steps already marked, I will pioneer a new way, explore unknown powers, and unfold to the world the deepest mysteries of creation.",
3
  "long_text_license": "[This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook.]",
4
  "labels":"Batman,Science,Sound,Light,Creation,Optics,Eyes,Engineering,Color,Communication,Death",
5
+ "ground_labels":"Science,Sound,Light,Creation,Engineering,Communication,Death"
6
  }