Spaces:
Sleeping
Sleeping
madhavkotecha
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -30,13 +30,6 @@ class CRF_POS_Tagger:
|
|
30 |
"ness", "ous", "ship", "y", "es", "s"
|
31 |
]
|
32 |
|
33 |
-
self.interjections = {
|
34 |
-
'ah', 'alas', 'aha', 'bravo', 'darn', 'drat', 'eh', 'eek', 'eww',
|
35 |
-
'gosh', 'ha', 'hooray', 'hmm', 'huh', 'oops', 'ouch', 'phew',
|
36 |
-
'pow', 'yay', 'whoa', 'wow', 'yikes', 'yippee', 'uh', 'um',
|
37 |
-
'hey', 'hello'
|
38 |
-
}
|
39 |
-
|
40 |
self.prefix_pattern = f"^({'|'.join(self.prefixes)})"
|
41 |
self.suffix_pattern = f"({'|'.join(self.suffixes)})$"
|
42 |
|
@@ -155,8 +148,8 @@ class CRF_POS_Tagger:
|
|
155 |
|
156 |
return features
|
157 |
|
158 |
-
def train(self, data
|
159 |
-
X_train, y_train = zip(*data)
|
160 |
self.crf_model.fit(X_train, y_train)
|
161 |
|
162 |
def predict(self, X_test):
|
|
|
30 |
"ness", "ous", "ship", "y", "es", "s"
|
31 |
]
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
self.prefix_pattern = f"^({'|'.join(self.prefixes)})"
|
34 |
self.suffix_pattern = f"({'|'.join(self.suffixes)})$"
|
35 |
|
|
|
148 |
|
149 |
return features
|
150 |
|
151 |
+
def train(self, data):
|
152 |
+
X_train, y_train = zip(*data)
|
153 |
self.crf_model.fit(X_train, y_train)
|
154 |
|
155 |
def predict(self, X_test):
|