이 시점에서 그것을 사용하는 방법을 이해하고 있지 않다 당신이이 파일에있는 항아리가 필요합니다 (그들은 모두 중국 모델 항아리에서 찾을 수 있습니다) :
stanford-corenlp-3.8.0.jar
: 당신은 메인 배포판에서이 항아리를 포함 할 수
edu/stanford/nlp/models/segmenter/chinese/dict-chris6.ser.gz
edu/stanford/nlp/models/segmenter/chinese/ctb.gz
StanfordCoreNLP-chinese.properties
코드를 얻을 수 당신은 매우 엄격한 크기 요구 사항이 있기 때문에 안드로이드 응용 프로그램과 함께이 통합하려는 경우
https://stanfordnlp.github.io/CoreNLP/download.html
당신은 몇 가지 작은 항아리를 만들기 위해해야 할 것 :
내가 위에서 언급 한 파일은 여기 중국 모델 항아리 사용할 수 있습니다. 분할 자 실행에 필요하지 않은 대부분의 코드를 잘라내는 것이 좋습니다.
당신은 스탠포드 - 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
유통 분할기 독립을 사용하는 것이 더 쉬울 수 있습니다
는 또한 여기에 동일한 프로세스, 더 많은 정보를 실행하는 독립 분할기을 다운로드 할 수 있습니다. 이 경우 Java API 사용법을 보여주는 SegDemo.java라는 데모가 있습니다. 위에서 제공된 샘플 코드는 독립형 분류기의 클래스를 사용하는 경우 작동하지 않습니다.