forked from jbingel/lexi-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
towards 0.3, new structure for simplification pipeline, move away fro…
…m Pickle
- Loading branch information
Showing
28 changed files
with
487 additions
and
11,410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ models/* | |
*.pyc | ||
trash/ | ||
.idea | ||
lexi.cfg | ||
lexi.cfg | ||
lexi/res/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# # # Feature Functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,9 @@ | ||
from abc import ABCMeta, abstractmethod | ||
from sacremoses import MosesDetokenizer | ||
|
||
detokenizer = MosesDetokenizer() | ||
|
||
|
||
class Classifier(metaclass=ABCMeta): | ||
# @abstractmethod | ||
# def fresh_train(self, x, y): | ||
# pass | ||
|
||
@abstractmethod | ||
def predict(self, x, ranker=None): | ||
raise NotImplementedError | ||
class SimplificationPipeline(metaclass=ABCMeta): | ||
|
||
@abstractmethod | ||
def predict_text(self, txt, startOffset=0, endOffset=None, ranker=None): | ||
def simplify_text(self, txt, startOffset=0, endOffset=None, | ||
cwi=None, ranker=None): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def update(self, x, y): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def save(self): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def load(self, model_id): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def load_default_init(self): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def check_featurizer_set(self): | ||
raise NotImplementedError | ||
|
||
|
||
# Classifier.register(DummyLexicalClassifier) | ||
# Classifier.register(PystructClassifier) | ||
# Classifier.register(LexensteinSimplifier) | ||
# PystructClassifier.register(ChainCRFClassifier) | ||
# PystructClassifier.register(EdgeCRFClassifier) | ||
# Classifier.register(AveragedPerceptron) | ||
# Classifier.register(OnlineStructuredPerceptron) |
Oops, something went wrong.