alanakbik commited on
Commit
3f6a24b
1 Parent(s): c80b30b

Update example for Flar 0.12.2

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -37,14 +37,14 @@ def get_model(model_name):
37
  return SequenceTagger.load(model_map[model_name])
38
 
39
 
40
- @st.cache(allow_output_mutation=True)
41
- def get_frame_definitions():
42
- frame_definition_map = {}
43
- with open('propbank_frames_3.1.txt') as infile:
44
- for line in infile:
45
- frame_definition_map[line.split('\t')[0]] = line.split('\t')[1]
46
-
47
- return frame_definition_map
48
 
49
 
50
  def get_html(html: str):
@@ -71,8 +71,8 @@ button_clicked = st.button("**Click here** to tag the input text", key=None)
71
 
72
  if button_clicked:
73
 
74
- if 'frame' in selected_model_id.lower():
75
- frame_definition_map = get_frame_definitions()
76
 
77
  # get a sentence splitter and split text into sentences
78
  splitter = SegtokSentenceSplitter()
 
37
  return SequenceTagger.load(model_map[model_name])
38
 
39
 
40
+ # @st.cache(allow_output_mutation=True)
41
+ # def get_frame_definitions():
42
+ # frame_definition_map = {}
43
+ # with open('propbank_frames_3.1.txt') as infile:
44
+ # for line in infile:
45
+ # frame_definition_map[line.split('\t')[0]] = line.split('\t')[1]
46
+ #
47
+ # return frame_definition_map
48
 
49
 
50
  def get_html(html: str):
 
71
 
72
  if button_clicked:
73
 
74
+ # if 'frame' in selected_model_id.lower():
75
+ # frame_definition_map = get_frame_definitions()
76
 
77
  # get a sentence splitter and split text into sentences
78
  splitter = SegtokSentenceSplitter()