onurkeles commited on
Commit
71a4a8b
1 Parent(s): 0d4bf03

Update pos_tagger.py

Browse files
Files changed (1) hide show
  1. pos_tagger.py +21 -26
pos_tagger.py CHANGED
@@ -38,29 +38,24 @@ def write():
38
  help="If checked, output shows detailed tag information (probability scores, etc.).",
39
  )
40
 
41
- # Input field for text
42
- input_text = st.text_area(label='Enter a text: ', height=100, value="Put example text here.")
43
-
44
- # Provide example sentences with translations
45
- example_sentences = [
46
- "tuute acertsetser topoldetser. aaav ta? (TR: Kâğıdı büzüştürdün attın. Oldu mu?)",
47
- "Baran u Baden teran. (TR: Baran ve Bade koştu.)",
48
- "Onurun ennush nu İremin terchushe intzi shad kızdırmısh aaav. (TR: Onur'un düşüşü ve İrem'in koşuşu beni kızdırdı.)"
49
- ]
50
-
51
- st.write("## Example Sentences:")
52
- for example in example_sentences:
53
- hamshetsnag_text, turkish_translation = example.split('(TR:')
54
- hamshetsnag_text = hamshetsnag_text.strip()
55
- turkish_translation = turkish_translation.split(')')[0].strip()
56
-
57
- if st.button(f"Use: {hamshetsnag_text}"):
58
- input_text = hamshetsnag_text # Update the input text directly with the Hamshetsnag part
59
- st.write(f"<!--TR: {turkish_translation}-->") # Display Turkish translation as a comment
60
- break # Only use the first clicked example
61
-
62
- if st.button("Tag POS"):
63
- with st.spinner('Processing...'):
64
- # Tag the input text and format output as per settings
65
- output = tag_pos(input_text, detailed_output)
66
- st.success(output)
 
38
  help="If checked, output shows detailed tag information (probability scores, etc.).",
39
  )
40
 
41
+ # Input field for text
42
+ input_text = st.text_area(label='Enter a text: ', height=100, value="Put example text here.")
43
+
44
+ # Provide example sentences with translations
45
+ example_sentences = [
46
+ "tuute acertsetser topoldetser. aaav ta? (TR: Kâğıdı büzüştürdün attın. Oldu mu?)",
47
+ "Baran u Baden teran. (TR: Baran ve Bade koştu.)",
48
+ "Onurun ennush nu İremin terchushe intzi shad kızdırmısh aaav. (TR: Onur'un düşüşü ve İrem'in koşuşu beni kızdırdı.)"
49
+ ]
50
+
51
+ st.write("## Example Sentences:")
52
+ for example in example_sentences:
53
+ if st.button(f"Use: {example.split('(TR:')[0].strip()}"):
54
+ input_text = example.split('(TR:')[0].strip() # Update the input text directly with the Hamshetsnag part
55
+ break # Only use the first clicked example
56
+
57
+ if st.button("Tag POS"):
58
+ with st.spinner('Processing...'):
59
+ # Tag the input text and format output as per settings
60
+ output = tag_pos(input_text, detailed_output)
61
+ st.success(output)