亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? chunkerme.java

?? 自然語言處理領域的一個開發包
?? JAVA
字號:
/////////////////////////////////////////////////////////////////////////////////Copyright (C) 2003 Thomas Morton// //This library is free software; you can redistribute it and/or//modify it under the terms of the GNU Lesser General Public//License as published by the Free Software Foundation; either//version 2.1 of the License, or (at your option) any later version.// //This library is distributed in the hope that it will be useful,//but WITHOUT ANY WARRANTY; without even the implied warranty of//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//GNU Lesser General Public License for more details.// //You should have received a copy of the GNU Lesser General Public//License along with this program; if not, write to the Free Software//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.//////////////////////////////////////////////////////////////////////////////package opennlp.tools.chunker;import java.util.Arrays;import java.util.List;import opennlp.maxent.GISModel;import opennlp.maxent.MaxentModel;import opennlp.maxent.TwoPassDataIndexer;import opennlp.tools.util.BeamSearch;import opennlp.tools.util.Sequence;/** * The class represents a maximum-entropy-based chunker.  Such a chunker can be used to * find flat structures based on sequence inputs such as noun phrases or named entities. * */public class ChunkerME implements Chunker {  /** The beam used to search for sequences of chunk tag assignments. */  protected BeamSearch beam;  private Sequence bestSequence;  /** The model used to assign chunk tags to a sequence of tokens. */  protected MaxentModel model;  /**   * Creates a chunker using the specified model.   * @param mod The maximum entropy model for this chunker.   */  public ChunkerME(MaxentModel mod) {    this(mod, new DefaultChunkerContextGenerator(), 10);  }  /**   * Creates a chunker using the specified model and context generator.   * @param mod The maximum entropy model for this chunker.   * @param cg The context generator to be used by the specified model.   */  public ChunkerME(MaxentModel mod, ChunkerContextGenerator cg) {    this(mod, cg, 10);  }  /**   * Creates a chunker using the specified model and context generator and decodes the   * model using a beam search of the specified size.   * @param mod The maximum entropy model for this chunker.   * @param cg The context generator to be used by the specified model.   * @param beamSize The size of the beam that should be used when decoding sequences.   */  public ChunkerME(MaxentModel mod, ChunkerContextGenerator cg, int beamSize) {    beam = new ChunkBeamSearch(beamSize, cg, mod);    this.model = mod;  }  /* inherieted javadoc */  public List chunk(List toks, List tags) {    bestSequence =        beam.bestSequence(toks, new Object[] { (String[]) tags.toArray(new String[tags.size()]) });    return bestSequence.getOutcomes();  }    /* inherieted javadoc */  public String[] chunk(Object[] toks, String[] tags) {    bestSequence = beam.bestSequence(Arrays.asList(toks), new Object[] {tags});    List c = bestSequence.getOutcomes();    return (String[]) c.toArray(new String[c.size()]);  }  /**    * This method determines wheter the outcome is valid for the preceeding sequence.     * This can be used to implement constraints on what sequences are valid.     * @param outcome The outcome.   * @param sequence The precceding sequence of outcome assignments.    * @return true is the outcome is valid for the sequence, false otherwise.   */  protected boolean validOutcome(String outcome, Sequence sequence) {    return (true);  }    /**     * This method determines wheter the outcome is valid for the preceeding sequence.      * This can be used to implement constraints on what sequences are valid.      * @param outcome The outcome.    * @param sequence The precceding sequence of outcome assignments.     * @return true is the outcome is valid for the sequence, false otherwise.    */  protected boolean validOutcome(String outcome, String[] sequence) {    return (true);  }  /**   * This class implements the abstract BeamSearch class to allow for the chunker to use   * the common beam search code.    *   */  class ChunkBeamSearch extends BeamSearch {        public ChunkBeamSearch(int size, ChunkerContextGenerator cg, MaxentModel model) {      super(size, cg, model);    }        /* inherieted java doc */    protected boolean validSequence(int i, List sequence, Sequence s, String outcome) {      return validOutcome(outcome, s);    }        protected boolean validSequence(int i, Object[] sequence, String[] s, String outcome) {      return validOutcome(outcome, s);    }  }  /**   * Populates the specified array with the probabilities of the last decoded sequence.  The   * sequence was determined based on the previous call to <code>chunk</code>.  The    * specified array should be at least as large as the numbe of tokens in the previous call to <code>chunk</code>.   * @param probs An array used to hold the probabilities of the last decoded sequence.   */  public void probs(double[] probs) {    bestSequence.getProbs(probs);  }    /**     * Returns an array with the probabilities of the last decoded sequence.  The     * sequence was determined based on the previous call to <code>chunk</code>.     * @return An array with the same number of probabilities as tokens were sent to <code>chunk</code>     * when it was last called.        */  public double[] probs() {    return bestSequence.getProbs();  }    private static GISModel train(opennlp.maxent.EventStream es, int iterations, int cut) throws java.io.IOException {    return opennlp.maxent.GIS.trainModel(iterations, new TwoPassDataIndexer(es, cut));  }  /**   * Trains the chunker using the specified parameters. <br>   * Usage: ChunkerME trainingFile modelFile. <br>   * Training file should be one word per line where each line consists of a    * space-delimited triple of "word pos outcome".  Sentence breaks are indicated by blank lines.   * @param args The training file and the model file.   * @throws java.io.IOException When the specifed files can not be read.   */  public static void main(String[] args) throws java.io.IOException {    if (args.length == 0) {      System.err.println("Usage: ChunkerME trainingFile modelFile");      System.err.println();      System.err.println("Training file should be one word per line where each line consists of a ");      System.err.println("space-delimited triple of \"word pos outcome\".  Sentence breaks are indicated by blank lines.");      System.exit(1);    }    java.io.File inFile = new java.io.File(args[0]);    java.io.File outFile = new java.io.File(args[1]);    GISModel mod;    opennlp.maxent.EventStream es = new ChunkerEventStream(new opennlp.maxent.PlainTextByLineDataStream(new java.io.FileReader(inFile)));    if (args.length > 3)      mod = train(es, Integer.parseInt(args[2]), Integer.parseInt(args[3]));    else      mod = train(es, 100, 5);    System.out.println("Saving the model as: " + args[1]);    new opennlp.maxent.io.SuffixSensitiveGISModelWriter(mod, outFile).persist();  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀久久99精品久久久久久9| www.亚洲色图| 不卡视频在线观看| 3d动漫精品啪啪一区二区竹菊| 欧美激情一区二区三区蜜桃视频| 污片在线观看一区二区| 成人不卡免费av| 久久综合久久99| 日韩—二三区免费观看av| 91国模大尺度私拍在线视频| 国产精品乱人伦中文| 国产精品资源网| 日韩西西人体444www| 午夜日韩在线电影| 一本久久a久久精品亚洲| 国产精品毛片a∨一区二区三区| 激情欧美日韩一区二区| 日韩无一区二区| 人禽交欧美网站| 欧美卡1卡2卡| 婷婷国产在线综合| 精品视频在线免费观看| 亚洲香肠在线观看| 欧美三片在线视频观看| 亚洲一区视频在线观看视频| 91论坛在线播放| 亚洲人精品午夜| 成人国产精品免费观看动漫| 国产精品拍天天在线| 成人午夜碰碰视频| 国产精品女上位| av男人天堂一区| 最新国产の精品合集bt伙计| 精品少妇一区二区三区免费观看| 亚洲电影一级黄| 91精品在线免费观看| 日韩国产一区二| 91麻豆精品国产自产在线 | 国产亚洲欧美中文| 国产一区激情在线| 欧美精品一区二区三区久久久| 精一区二区三区| 国产婷婷色一区二区三区在线| 成人动漫在线一区| 一区二区三区中文免费| 欧美日韩国产色站一区二区三区| 午夜在线成人av| 精品久久五月天| 国产91综合网| 亚洲另类中文字| 欧美日本一道本在线视频| 日本v片在线高清不卡在线观看| 精品毛片乱码1区2区3区 | 青青国产91久久久久久| 欧美变态凌虐bdsm| 成人自拍视频在线| 亚洲一区影音先锋| 精品电影一区二区| 成人黄色在线视频| 五月婷婷综合在线| 久久久久久综合| 色综合久久久久网| 久久成人免费电影| 综合网在线视频| 欧美v国产在线一区二区三区| 成人午夜免费av| 视频一区二区中文字幕| 亚洲国产岛国毛片在线| 欧美日韩卡一卡二| 成人午夜伦理影院| 日韩精品一二区| 亚洲欧洲综合另类| 久久综合狠狠综合| 欧美最猛性xxxxx直播| 国产精品99久久久久久宅男| 亚洲一区二区三区四区中文字幕 | 国产精品不卡一区二区三区| 欧美日韩亚洲丝袜制服| 成人激情电影免费在线观看| 免费在线观看精品| 夜夜嗨av一区二区三区网页 | 一区二区三区在线视频播放 | 欧美一区二区三区喷汁尤物| 成人av在线一区二区| 精品一区二区三区免费| 亚洲一区精品在线| 亚洲欧洲日韩在线| 国产网站一区二区| 日韩一级大片在线观看| 中文字幕亚洲欧美在线不卡| 欧美一区二区不卡视频| 欧美日韩国产中文| 一本大道综合伊人精品热热| 大白屁股一区二区视频| 久久99久久久欧美国产| 日韩高清国产一区在线| 五月综合激情婷婷六月色窝| 一区二区三区在线免费观看| 综合久久久久久| 国产精品久久久久精k8| 久久亚洲影视婷婷| 日韩精品一区二区三区swag| 欧美色综合网站| 欧美日韩视频在线一区二区| 欧美在线你懂的| 91猫先生在线| 99九九99九九九视频精品| 9色porny自拍视频一区二区| 国产91露脸合集magnet | 色综合天天性综合| 成人国产免费视频| 99国产精品久| 91在线观看视频| 91蜜桃在线免费视频| 91免费在线播放| 欧美亚一区二区| 欧美伊人久久久久久久久影院| 色综合亚洲欧洲| 欧美视频在线观看一区二区| 日本二三区不卡| 欧美日韩在线不卡| 91精品国产综合久久婷婷香蕉 | 国产欧美日韩另类视频免费观看| 337p日本欧洲亚洲大胆色噜噜| 久久久久久久免费视频了| 久久亚洲私人国产精品va媚药| 久久久久久免费| 专区另类欧美日韩| 亚洲一区中文在线| 蜜臀精品一区二区三区在线观看 | 国产性色一区二区| 中文字幕一区二区三区色视频| 亚洲视频一区二区在线观看| 夜夜操天天操亚洲| 久久精品国产99| 成人三级在线视频| 欧美中文字幕亚洲一区二区va在线| 欧美日本乱大交xxxxx| 久久综合一区二区| 亚洲欧美一区二区三区国产精品| 亚洲成va人在线观看| 国内外成人在线| 91丨porny丨中文| 欧美色图一区二区三区| 欧美一区二区精美| 国产精品久久午夜夜伦鲁鲁| 亚洲v中文字幕| 国产一区二区导航在线播放| 一本色道a无线码一区v| 日韩免费观看高清完整版| 一区在线观看视频| 日韩电影在线观看网站| 成人av网址在线| 欧美精品久久天天躁| 国产无人区一区二区三区| 国产精品中文字幕日韩精品| 色菇凉天天综合网| 久久久青草青青国产亚洲免观| 亚洲日本va午夜在线影院| 欧美96一区二区免费视频| 成人a级免费电影| 欧美不卡在线视频| 亚洲一区二区成人在线观看| 国产一区二区看久久| 欧美日韩午夜精品| 亚洲私人影院在线观看| 国产真实乱偷精品视频免| 欧美少妇性性性| 国产精品护士白丝一区av| 国产在线精品国自产拍免费| 欧美丝袜丝nylons| 综合分类小说区另类春色亚洲小说欧美| 日本伊人精品一区二区三区观看方式| av爱爱亚洲一区| 国产欧美精品区一区二区三区| 蜜臀精品一区二区三区在线观看| 欧美亚洲国产bt| 亚洲精品中文字幕在线观看| 国产成a人无v码亚洲福利| 欧美tk—视频vk| 三级一区在线视频先锋| 欧美无乱码久久久免费午夜一区| 中文字幕中文字幕一区| 国产伦精一区二区三区| 精品成a人在线观看| 美女看a上一区| 91精品国产高清一区二区三区| 亚洲一区二区在线免费看| 97aⅴ精品视频一二三区| 国产精品国产三级国产普通话99 | 欧美疯狂性受xxxxx喷水图片| 亚洲精品久久7777| 99久久99久久久精品齐齐| 中文字幕欧美激情一区| 国产精品一级片| 国产欧美日韩在线观看| 成人一区在线看| 中文字幕在线观看不卡| av电影在线观看不卡 | 国产亚洲1区2区3区|