を理解していないですそれ(彼らはすべての中国のモデルジャーで見つけることができます):
edu/stanford/nlp/models/segmenter/chinese/dict-chris6.ser.gz
edu/stanford/nlp/models/segmenter/chinese/ctb.gz
StanfordCoreNLP-chinese.properties
あなたは、コードを取得するには、メインディストリビューションからこのjarファイルを含めることができます
stanford-corenlp-3.8.0.jar
私は上記参照
ファイルはここにあり、中国のモデルジャーで提供されています:https://stanfordnlp.github.io/CoreNLP/download.html
あなたは非常に厳しいサイズ要件があるため、Androidアプリでこれを統合したい場合は、いくつかの小さな瓶を作成する必要があるとしています。私は、セグメンタを実行するだけでは不要なコードの大部分を切り捨てることをお勧めします。
あなたはスタンフォード・corenlp-3.8.0.jarを使用している場合、これはいくつかのサンプルコードです:
package edu.stanford.nlp.examples;
import edu.stanford.nlp.ling.*;
import edu.stanford.nlp.pipeline.*;
import edu.stanford.nlp.util.*;
import java.util.*;
public class PipelineExample {
public static void main(String[] args) {
// set up pipeline properties
Properties props = StringUtils.argsToProperties("-props", "StanfordCoreNLP-chinese.properties");
props.setProperty("annotators", "tokenize,ssplit");
// set up Stanford CoreNLP pipeline
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
// build annotation for a review
Annotation annotation = new Annotation("...Chinese text to segment...");
// annotate the review
pipeline.annotate(annotation);
for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) {
for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {
System.out.println(token);
}
}
}
}
あなたが最低限まで瓶を縮小するためにいくつかの作業を行うことになるでしょう、最終的にはこのたくさんのクラスを削除し、それでも問題が適切に実行されるようにする必要があります。
また、ここでは詳細は同じプロセスを実行するスタンドアロンセグメンタをダウンロードできます。スタンドアロンのセグメンタ分布を使用する方が簡単かもしれません
https://nlp.stanford.edu/software/segmenter.html
を。この場合、SegDemo.javaというデモがJava APIの使用状況を示します。上記のサンプルコードは、スタンドアロンのセグメンタのクラスを使用する場合は機能しません。