Search in sources :

Example 1 with WeightLookup

use of zemberek.core.data.WeightLookup in project zemberek-nlp by ahmetaa.

the class PerceptronAmbiguityResolver method fromResource.

public static PerceptronAmbiguityResolver fromResource(String resourcePath) throws IOException {
    WeightLookup lookup;
    if (CompressedWeights.isCompressed(resourcePath)) {
        lookup = CompressedWeights.deserialize(resourcePath);
    } else {
        lookup = Weights.loadFromResource(resourcePath);
    }
    FeatureExtractor extractor = new FeatureExtractor(false);
    return new PerceptronAmbiguityResolver(lookup, extractor);
}
Also used : WeightLookup(zemberek.core.data.WeightLookup)

Example 2 with WeightLookup

use of zemberek.core.data.WeightLookup in project zemberek-nlp by ahmetaa.

the class PerceptronAmbiguityResolver method fromModelFile.

public static PerceptronAmbiguityResolver fromModelFile(Path modelFile) throws IOException {
    WeightLookup lookup;
    if (CompressedWeights.isCompressed(modelFile)) {
        lookup = CompressedWeights.deserialize(modelFile);
    } else {
        lookup = Weights.loadFromFile(modelFile);
    }
    FeatureExtractor extractor = new FeatureExtractor(false);
    return new PerceptronAmbiguityResolver(lookup, extractor);
}
Also used : WeightLookup(zemberek.core.data.WeightLookup)

Aggregations

WeightLookup (zemberek.core.data.WeightLookup)2