Пример #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
Пример #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"))
Пример #3
0
 def load(path):
     return load_with_pickle(path, "feature_extractor.pkl")
Пример #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"))
Пример #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"))
Пример #6
0
 def load(path):
     return load_with_pickle(path, "feature_computer.pkl")
Пример #7
0
 def load_file(path: str, name: str) -> List[Document]:
     return load_with_pickle(path, name)
Пример #8
0
def load(path: str) -> List[Document]:
    return load_with_pickle(path, "docs.pkl")
Пример #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)