• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Lemmatiser类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中dragon.nlp.tool.Lemmatiser的典型用法代码示例。如果您正苦于以下问题:Java Lemmatiser类的具体用法?Java Lemmatiser怎么用?Java Lemmatiser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Lemmatiser类属于dragon.nlp.tool包,在下文中一共展示了Lemmatiser类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: String2TokenSequencePipe

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
public String2TokenSequencePipe(Lemmatiser lemmatiser, Tagger posTagger, boolean useNumericNormalization, banner.tagging.Tagger preTagger)
{
	super(null, LabelAlphabet.class);
	this.lemmatiser = lemmatiser;
	this.posTagger = posTagger;
	this.useNumericNormalization = useNumericNormalization;
	this.preTagger = preTagger;
}
 

开发者ID:clulab,
项目名称:reach-banner,
代码行数:9,
代码来源:String2TokenSequencePipe.java

示例2: String2TokenSequencePipe

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
public String2TokenSequencePipe(Lemmatiser lemmatiser, Tagger posTagger, boolean useNumericNormalization)
{
    super(null, LabelAlphabet.class);
    this.lemmatiser = lemmatiser;
    this.posTagger = posTagger;
    this.useNumericNormalization = useNumericNormalization;
}
 

开发者ID:leebird,
项目名称:legonlp,
代码行数:8,
代码来源:String2TokenSequencePipe.java

示例3: setLemmatiser

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
public void setLemmatiser(Lemmatiser lemmatiser)
{
	this.lemmatiser = lemmatiser;
}
 

开发者ID:clulab,
项目名称:reach-banner,
代码行数:5,
代码来源:String2TokenSequencePipe.java

示例4: train

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
/**
 * Trains and returns a {@link CRFTagger} on the specified {@link Sentence}
 * s. This method may take hours or even days to complete. When training,
 * you will likely need to increase the amount of memory used by the Java
 * virtual machine (try adding "-Xms1024m" to the command line).
 * 
 * @param sentences
 *            The {@link Sentence}s to train the tagger on
 * @param order
 *            The CRF order to use
 * @param useFeatureInduction
 *            Whether or not to use feature induction
 * @param format
 *            The {@link TagFormat} to use
 * @param textDirection
 *            The {@link TextDirection} to use
 * @param lemmatiser
 *            The {@link Lemmatiser} to use
 * @param posTagger
 *            The part-of-speech {@link dragon.nlp.tool.Tagger} to use
 * @param useNumericalNormalization
 *            Whether to use numeric normalization
 * @return A trained CRFTagger; ready to tag unseen sentences or be output
 *         to disk
 */
public static CRFTagger train(List<Sentence> sentences, int order, boolean useFeatureInduction, TagFormat format, TextDirection textDirection, Lemmatiser lemmatiser,
		dragon.nlp.tool.Tagger posTagger, boolean useNumericalNormalization, Tagger preTagger, String regexFilename)
{
	if (sentences.size() == 0)
		throw new RuntimeException("Number of sentences must be greater than zero");
	String2TokenSequencePipe localBasePipe = new String2TokenSequencePipe(lemmatiser, posTagger, useNumericalNormalization, preTagger);
	ArrayList<Pipe> pipes = new ArrayList<Pipe>();
	pipes.add(localBasePipe);
	setupPipes(pipes, regexFilename);
	Pipe pipe = new SerialPipes(pipes);
	CRF4 forwardCRF = null;
	if (textDirection == TextDirection.Intersection)
		throw new UnsupportedOperationException("TextDirection.Intersection not yet supported");
	if (textDirection.doForward())
		forwardCRF = train(sentences, order, useFeatureInduction, format, pipe, false);
	CRF4 reverseCRF = null;
	if (textDirection.doReverse())
		reverseCRF = train(sentences, order, useFeatureInduction, format, pipe, true);
	return new CRFTagger(forwardCRF, reverseCRF, localBasePipe, order, useFeatureInduction, format, textDirection);
}
 

开发者ID:clulab,
项目名称:reach-banner,
代码行数:46,
代码来源:CRFTagger.java

示例5: setLemmatiser

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
public void setLemmatiser(Lemmatiser lemmatiser)
{
    this.lemmatiser = lemmatiser;
}
 

开发者ID:leebird,
项目名称:legonlp,
代码行数:5,
代码来源:String2TokenSequencePipe.java

示例6: train

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
/**
 * Trains and returns a {@link CRFTagger} on the specified {@link Sentence}s. This method may take hours or even days to complete. When training,
 * you will likely need to increase the amount of memory used by the Java virtual machine (try adding "-Xms1024m" to the command line).
 * 
 * @param sentences
 *        The {@link Sentence}s to train the tagger on
 * @param order
 *        The CRF order to use
 * @param useFeatureInduction
 *        Whether or not to use feature induction
 * @param format
 *        The {@link TagFormat} to use
 * @param textDirection
 *        The {@link TextDirection} to use
 * @param lemmatiser
 *        The {@link Lemmatiser} to use
 * @param posTagger
 *        The part-of-speech {@link dragon.nlp.tool.Tagger} to use
 * @param useNumericalNormalization
 *        Whether to use numeric normalization
 * @return A trained CRFTagger; ready to tag unseen sentences or be output to disk
 */
public static CRFTagger train(List<Sentence> sentences, int order, boolean useFeatureInduction, TagFormat format, TextDirection textDirection,
                              Lemmatiser lemmatiser, dragon.nlp.tool.Tagger posTagger, boolean useNumericalNormalization)
{
    if (sentences.size() == 0)
        throw new RuntimeException("Number of sentences must be greater than zero");
    String2TokenSequencePipe localBasePipe = new String2TokenSequencePipe(lemmatiser, posTagger, useNumericalNormalization);
    ArrayList<Pipe> pipes = new ArrayList<Pipe>();
    pipes.add(localBasePipe);
    setupPipes(pipes);
    Pipe pipe = new SerialPipes(pipes);
    CRF4 forwardCRF = null;
    if (textDirection == TextDirection.Intersection)
        throw new UnsupportedOperationException("TextDirection.Intersection not yet supported");
    if (textDirection.doForward())
        forwardCRF = train(sentences, order, useFeatureInduction, format, pipe, false);
    CRF4 reverseCRF = null;
    if (textDirection.doReverse())
        reverseCRF = train(sentences, order, useFeatureInduction, format, pipe, true);
    return new CRFTagger(forwardCRF, reverseCRF, localBasePipe, order, useFeatureInduction, format, textDirection);
}
 

开发者ID:leebird,
项目名称:legonlp,
代码行数:43,
代码来源:CRFTagger.java

示例7: train

点赞 2

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
/**
 * Trains and returns a {@link CRFTagger} on the specified {@link Sentence}s. This method may take hours or even days to complete. When training,
 * you will likely need to increase the amount of memory used by the Java virtual machine (try adding "-Xms1024m" to the command line).
 *
 * @param sentences
 *        The {@link Sentence}s to train the tagger on
 * @param order
 *        The crf order to use
 * @param useFeatureInduction
 *        Whether or not to use feature induction
 * @param format
 *        The {@link TagFormat} to use
 * @param textDirection
 *        The {@link TextDirection} to use
 * @param lemmatiser
 *        The {@link Lemmatiser} to use
 * @param posTagger
 *        The part-of-speech {@link dragon.nlp.tool.Tagger} to use
 * @param useNumericalNormalization
 *        Whether to use numeric normalization
 * @return A trained CRFTagger; ready to tag unseen sentences or be output to disk
 */
public static CRFTagger train(List<Sentence> sentences, int order, boolean useFeatureInduction, TagFormat format, TextDirection textDirection,
                              Lemmatiser lemmatiser, dragon.nlp.tool.Tagger posTagger, boolean useNumericalNormalization)
{
    if (sentences.size() == 0)
        throw new RuntimeException("Number of sentences must be greater than zero");
    String2TokenSequencePipe localBasePipe = new String2TokenSequencePipe(lemmatiser, posTagger, useNumericalNormalization);
    ArrayList<Pipe> pipes = new ArrayList<Pipe>();
    pipes.add(localBasePipe);
    setupPipes(pipes);
    Pipe pipe = new SerialPipes(pipes);
    CRF4 forwardCRF = null;
    if (textDirection == TextDirection.Intersection)
        throw new UnsupportedOperationException("TextDirection.Intersection not yet supported");
    if (textDirection.doForward())
        forwardCRF = train(sentences, order, useFeatureInduction, format, pipe, false);
    CRF4 reverseCRF = null;
    if (textDirection.doReverse())
        reverseCRF = train(sentences, order, useFeatureInduction, format, pipe, true);
    return new CRFTagger(forwardCRF, reverseCRF, localBasePipe, order, useFeatureInduction, format, textDirection);
}
 

开发者ID:karahindiba,
项目名称:WikiInfoboxExtractor,
代码行数:43,
代码来源:Banner.java

示例8: load

点赞 1

import dragon.nlp.tool.Lemmatiser; //导入依赖的package包/类
/**
 * Loads a {@link CRFTagger} from the specified file. As the lemmatiser and
 * part-of-speech tagger both require data, these cannot be written to disk
 * and must be passed in new. This version of the method assumes no
 * preTagger; it is primarily intended for backwards compatibility.
 * 
 * @param f
 *            The file to load the CRFTagger from, as written by the {@link}
 *            write() method.
 * @param lemmatiser
 *            The {@link Lemmatiser} to use
 * @param posTagger
 *            The part-of-speech {@link dragon.nlp.tool.Tagger} to use
 * @throws IOException
 * @return A new instance of the CRFTagger contained in the specified file
 */
public static CRFTagger load(File f, Lemmatiser lemmatiser, dragon.nlp.tool.Tagger posTagger) throws IOException
{
	return load(f, lemmatiser, posTagger, null);
}
 

开发者ID:clulab,
项目名称:reach-banner,
代码行数:21,
代码来源:CRFTagger.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)