onurkeles commited on
Commit
c5e94e2
·
verified ·
1 Parent(s): 9ee13d7

Update pos_tagger.py

Browse files
Files changed (1) hide show
  1. pos_tagger.py +7 -7
pos_tagger.py CHANGED
@@ -39,11 +39,8 @@ def write():
39
  help="If checked, output shows detailed tag information (probability scores, etc.).",
40
  )
41
 
42
- # Input field for text
43
  input_text = st.text_area(label='Enter a text: ', height=100, value="Put example text here.")
44
- state = st.session_state
45
 
46
- # Provide example sentences with translations
47
  example_sentences = [
48
  "tuute acertsetser topoldetser. aaav ta? (TR: Kâğıdı büzüştürdün attın. Oldu mu?)",
49
  "Baran u Baden teran. (TR: Baran ve Bade koştu.)",
@@ -52,12 +49,15 @@ example_sentences = [
52
 
53
  st.write("## Example Sentences:")
54
  for example in example_sentences:
55
- if st.button(f"Use: {example.split('(TR:')[0].strip()}"):
56
- state.input_text = example.split('(TR:')[0].strip()
57
- break
 
 
 
 
58
 
59
  if st.button("Tag POS"):
60
  with st.spinner('Processing...'):
61
- input_text = state.input_text
62
  output = tag_pos(input_text, detailed_output)
63
  st.success(output)
 
39
  help="If checked, output shows detailed tag information (probability scores, etc.).",
40
  )
41
 
 
42
  input_text = st.text_area(label='Enter a text: ', height=100, value="Put example text here.")
 
43
 
 
44
  example_sentences = [
45
  "tuute acertsetser topoldetser. aaav ta? (TR: Kâğıdı büzüştürdün attın. Oldu mu?)",
46
  "Baran u Baden teran. (TR: Baran ve Bade koştu.)",
 
49
 
50
  st.write("## Example Sentences:")
51
  for example in example_sentences:
52
+ hamshetsnag_text, turkish_translation = example.split('(TR:')
53
+ hamshetsnag_text = hamshetsnag_text.strip()
54
+ turkish_translation = turkish_translation.split(')')[0].strip()
55
+
56
+ if st.button(f"Use: {hamshetsnag_text}"):
57
+ input_text = hamshetsnag_text # Update the input text directly with the Hamshetsnag part
58
+ st.write(f"<!--TR: {turkish_translation}-->") # Display Turkish translation as a comment
59
 
60
  if st.button("Tag POS"):
61
  with st.spinner('Processing...'):
 
62
  output = tag_pos(input_text, detailed_output)
63
  st.success(output)