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);
}
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);
}
Aggregations