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

Update pos_tagger.py

Browse files
Files changed (1) hide show
  1. pos_tagger.py +9 -10
pos_tagger.py CHANGED
@@ -39,8 +39,10 @@ def write():
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,15 +51,12 @@ example_sentences = [
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)
 
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
+
45
+ # Provide example sentences with translations
46
  example_sentences = [
47
  "tuute acertsetser topoldetser. aaav ta? (TR: Kâğıdı büzüştürdün attın. Oldu mu?)",
48
  "Baran u Baden teran. (TR: Baran ve Bade koştu.)",
 
51
 
52
  st.write("## Example Sentences:")
53
  for example in example_sentences:
54
+ if st.button(f"Use: {example.split('(TR:')[0].strip()}"):
55
+ input_text = example.split('(TR:')[0].strip() # Update the input text directly with the Turkish part
56
+ break # Only use the first clicked example
 
 
 
 
57
 
58
  if st.button("Tag POS"):
59
  with st.spinner('Processing...'):
60
+ # Tag the input text and format output as per settings
61
  output = tag_pos(input_text, detailed_output)
62
+ st.success(output)