Spaces:
Runtime error
Runtime error
Commit
·
227a8a7
1
Parent(s):
97f5365
test
Browse files
app.py
CHANGED
@@ -118,6 +118,20 @@ def process_text(model_name, task, text):
|
|
118 |
|
119 |
if model_name == 'gpt3.5':
|
120 |
if task == 'POS':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
strategy1_format = template_all.format(text)
|
122 |
strategy2_format = prompt2_pos.format(text)
|
123 |
strategy3_format = demon_pos
|
|
|
118 |
|
119 |
if model_name == 'gpt3.5':
|
120 |
if task == 'POS':
|
121 |
+
from transformers import pipeline
|
122 |
+
|
123 |
+
# Load the pipeline for part-of-speech tagging using the vicuna7b model
|
124 |
+
pos_pipeline = pipeline("ner", model="finiteautomata/bert2crf4ner-pos", tokenizer="finiteautomata/bert2crf4ner-pos")
|
125 |
+
|
126 |
+
# Define the input phrase
|
127 |
+
input_phrase = "A cat loves the beautiful dog in the neighbor's house"
|
128 |
+
|
129 |
+
# Use the pipeline to get the part-of-speech tags
|
130 |
+
pos_tags = pos_pipeline(input_phrase)
|
131 |
+
|
132 |
+
# Print the output
|
133 |
+
print(pos_tags)
|
134 |
+
|
135 |
strategy1_format = template_all.format(text)
|
136 |
strategy2_format = prompt2_pos.format(text)
|
137 |
strategy3_format = demon_pos
|