All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.ie.machinereading.RelationFeatureFactory Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version
package edu.stanford.nlp.ie.machinereading;

import edu.stanford.nlp.ie.machinereading.structure.RelationMention;
import edu.stanford.nlp.ling.Datum;

import java.util.Set;
import java.util.logging.Logger;

/**
 * Base class for feature factories
 * Created by Sonal Gupta.
 */
public abstract class RelationFeatureFactory {

  public static enum DEPENDENCY_TYPE {
    BASIC, COLLAPSED, COLLAPSED_CCPROCESSED;
  }

  /** If true, it does not create any lexicalized features from the first argument (needed for KBP) */
  protected boolean doNotLexicalizeFirstArg;

  /** Which dependencies to use for feature extraction */
  protected DEPENDENCY_TYPE dependencyType;

  public abstract Datum createDatum(RelationMention rel, String label);

  public abstract Datum createDatum(RelationMention rel);

  public void setDoNotLexicalizeFirstArgument(boolean doNotLexicalizeFirstArg){
    this.doNotLexicalizeFirstArg = doNotLexicalizeFirstArg;
  }

  public abstract String getFeature(RelationMention rel, String dependency_path_lowlevel);

  public abstract Set getFeatures(RelationMention rel, String dependency_path_words);

  /*
   * If in case, creating test datum is different.
   */
  public abstract Datum createTestDatum(RelationMention rel, Logger logger);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy