Exemple #1
0
def load_classifier(path, extractor_class, feature_computer_class, session):
    extractor = extractor_class.load(os.path.join(path, 'extractor'))
    feature_computer = feature_computer_class.load(
        os.path.join(path, "feature_computer"))
    saver = load_tf_model_with_saver(path, "model", session)
    graph = _convert_load_graph(session, load_with_pickle(path, "graph.pkl"))

    return extractor, feature_computer, graph, saver
Exemple #2
0
    def load(cls, path, session):
        extractor, feature_computer, graph, saver = load_classifier(
            path, RelExtFeatureExtractor, CompositeFeatureComputer, session)

        return cls(graph, extractor, feature_computer, session, saver, load_with_pickle(path, "collapser"))
 def load(path):
     return load_with_pickle(path, "feature_extractor.pkl")
Exemple #4
0
    def load(cls, path, session):
        extractor, feature_computer, graph, saver = load_classifier(
            path, NERFeatureExtractor, SyntacticFeatureComputer, session)

        return cls(graph, extractor, feature_computer, session, saver,
                   load_with_pickle(path, "post_processor"))
Exemple #5
0
    def load(cls, path, session):
        extractor, feature_computer, graph, saver = load_classifier(
            path, NETFeatureExtractor, SyntacticFeatureComputer, session)

        return cls(graph, extractor, feature_computer, session, saver,
                   load_with_pickle(path, "grouper_collapser"))
Exemple #6
0
 def load(path):
     return load_with_pickle(path, "feature_computer.pkl")
Exemple #7
0
 def load_file(path: str, name: str) -> List[Document]:
     return load_with_pickle(path, name)
Exemple #8
0
def load(path: str) -> List[Document]:
    return load_with_pickle(path, "docs.pkl")
Exemple #9
0
 def load(cls, path, session):
     extractor, feature_computer, graph, saver = load_classifier(
         path, CorefFeatureExtractor, FeatureComputer, session)
     classifiers = load_with_pickle(path, "classifiers.pkl")
     return cls(graph, extractor, feature_computer, session, saver, classifiers)