Spaces:
Sleeping
Sleeping
madhavkotecha
commited on
Commit
•
6757ba7
1
Parent(s):
66a377e
Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,7 @@ predicted_tags = predict_tags(new_sentence)
|
|
117 |
print(predicted_tags)
|
118 |
|
119 |
def tagging(input):
|
|
|
120 |
tagged_list = predict_tags(input)
|
121 |
output = ''.join(f"{word}[{tag}] " for word, tag in tagged_list)
|
122 |
return output
|
@@ -134,5 +135,5 @@ interface = gr.Interface(fn = tagging,
|
|
134 |
title = "Conditional Random Field POS Tagger",
|
135 |
description = "CS626 Assignment 1B (Autumn 2024)",
|
136 |
theme=gr.themes.Soft())
|
137 |
-
interface.launch(inline = False
|
138 |
|
|
|
117 |
print(predicted_tags)
|
118 |
|
119 |
def tagging(input):
|
120 |
+
input = (re.sub(r'(\S)([.,;:!?])', r'\1 \2', input.strip()))
|
121 |
tagged_list = predict_tags(input)
|
122 |
output = ''.join(f"{word}[{tag}] " for word, tag in tagged_list)
|
123 |
return output
|
|
|
135 |
title = "Conditional Random Field POS Tagger",
|
136 |
description = "CS626 Assignment 1B (Autumn 2024)",
|
137 |
theme=gr.themes.Soft())
|
138 |
+
interface.launch(inline = False)
|
139 |
|