使用stanford postagger词性标注

阅读更多

		//标注
		String model = "models/chinese.tagger";
		String content = "你们 是 祖国 美丽 盛开 的 花朵";
		MaxentTagger tagger = new MaxentTagger(model);
		List> sentences = MaxentTagger.tokenizeText(new BufferedReader(new StringReader(content)));
		for (ArrayList sentence : sentences) {
		   ArrayList tSentence = tagger.tagSentence(sentence);
		   System.out.println(tSentence);
		}
		
		//训练
		Map param = new HashMap();
		param.put("model", "models/modelFile.tagger");
		param.put("trainFile", "train/199801.txt");
		MaxentTagger.main(new String[]{
				//"-prop",(String)param.get("prop"), 
	    		"-model" ,(String)param.get("model") ,
	    		"-trainFile" ,(String)param.get("trainFile")}
	    );
 

你可能感兴趣的:(使用stanford postagger词性标注)