Spaces:
Sleeping
Sleeping
Update pos_tagger.py
Browse files- 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 |
-
|
47 |
-
|
48 |
-
|
49 |
-
]
|
50 |
-
|
51 |
-
st.write("## Example Sentences:")
|
52 |
-
for example in example_sentences:
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
if st.button(
|
58 |
-
|
59 |
-
|
60 |
-
|
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)
|
|
|
|
|
|
|
|
|
|