AhmedTaha012 commited on
Commit
2916ff8
1 Parent(s): 9add4ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -27,6 +27,20 @@ model = AutoModelForTokenClassification.from_pretrained("AhmedTaha012/finance-ne
27
  # torch.compile(model)
28
  # torch.compile(model)
29
  nlpPipe = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  def getSpeakers(data):
31
  if "Speakers" in data:
32
  return "\n".join([x for x in data.split("Speakers")[-1].split("\n") if "--" in x])
@@ -245,8 +259,10 @@ st.header("Transcript Analysis", divider='rainbow')
245
  mainTranscript = st.text_area("Enter the transcript:", height=100)
246
  doc = nlp(mainTranscript)
247
  sentences = [sent.text for sent in doc.sents]
248
- quarter = st.text_input('Enter your quarter', '')
249
- year = st.text_input('Enter your year', '')
 
 
250
  if st.button("Analyze"):
251
  transcript=replace_abbreviations(mainTranscript)
252
  transcript=replace_abbreviations(transcript)
 
27
  # torch.compile(model)
28
  # torch.compile(model)
29
  nlpPipe = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)
30
+
31
+
32
+
33
+ if "disabled" not in st.session_state:
34
+ st.session_state["disabled"] = False
35
+
36
+ def disable():
37
+ st.session_state["disabled"] = True
38
+
39
+ st.text_input(
40
+ "Enter some text",
41
+ disabled=st.session_state.disabled,
42
+ on_change=disable
43
+ )
44
  def getSpeakers(data):
45
  if "Speakers" in data:
46
  return "\n".join([x for x in data.split("Speakers")[-1].split("\n") if "--" in x])
 
259
  mainTranscript = st.text_area("Enter the transcript:", height=100)
260
  doc = nlp(mainTranscript)
261
  sentences = [sent.text for sent in doc.sents]
262
+ quarter = st.text_input('Enter your quarter', '',disabled=st.session_state.disabled,
263
+ on_change=disable)
264
+ year = st.text_input('Enter your year', '',disabled=st.session_state.disabled,
265
+ on_change=disable)
266
  if st.button("Analyze"):
267
  transcript=replace_abbreviations(mainTranscript)
268
  transcript=replace_abbreviations(transcript)