Examples of NERTagger


Examples of org.fnlp.nlp.cn.tag.NERTagger

   * @param path 模型所在目录,结尾不带"/"
   * @throws LoadModelException
   */
  public static void loadNER(String path) throws LoadModelException {
    if(ner==null && pos!=null){
      ner = new NERTagger(pos);
    }
  }
View Full Code Here

Examples of org.fnlp.nlp.cn.tag.NERTagger

   * @throws Exception
   * @throws 
   */
  public static void main(String[] args) throws Exception {
   
    NERTagger tag = new NERTagger("../models/seg.m","../models/pos.m");
    String str = " 新浪体育讯 北京时间4月15日03:00(英国当地时间14日20:00),2009/10赛季英格兰足球超级联赛第34轮一场焦点战在白鹿巷球场展开角逐,阿森纳客场1比2不敌托特纳姆热刺,丹尼-罗斯和拜尔先入两球,本特纳扳回一城。阿森纳仍落后切尔西6分(净胜球少15个),夺冠几成泡影。热刺近 7轮联赛取得6胜,继续以1分之差紧逼曼城。";
    HashMap<String, String> map = new HashMap<String, String>();
    tag.tag(str,map);
    System.out.println(map);
    map = tag.tagFile("../example-data/data-tag.txt");
    System.out.println(map);
    System.out.println("Done!");
  }
View Full Code Here

Examples of org.fnlp.nlp.cn.tag.NERTagger

   * @throws IOException
   * @throws 
   */
  public static void main(String[] args) throws Exception {
    // TODO Auto-generated method stub
    NERTagger tag = new NERTagger("./models/seg.m","./models/pos.m");
    ArrayList<String> str = MyCollection.loadList("./testcase/test case ner.txt",null);
   
   
    for(String s:str){
      System.out.println(s);
      HashMap<String, String> t = tag.tag(s);
      System.out.println(t);
    }
   
   
    testFile(tag,"../FudanNLP/example-data/text/1.txt");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.