edu.stanford.nlp.ie.desc
Class DescExtractor

java.lang.Object
  |
  +--edu.stanford.nlp.ie.AbstractFieldExtractor
        |
        +--edu.stanford.nlp.ie.SingleFieldExtractor
              |
              +--edu.stanford.nlp.ie.desc.DescExtractor
All Implemented Interfaces:
FieldExtractor, RankedExtractor, Serializable

public class DescExtractor
extends SingleFieldExtractor
implements Serializable

Implements a SingleFieldExtractor that attempts to extract a general description or descraphical information from the text. The DescExtractor uses a part of speech tagger to do its work (the one in edu.stanford.nlp.tagger.maxent). It needs data files for this tagger. Right now the solution to this is to specify the model name in a file in the current directory called descextractor.init . It should contain one line, which names the full path of the tagger model. Look in /u/nlp/java/edu/stanford/nlp/ie/test/ for an example. If it doesn't find the file, it will default to the model in /u/nlp/data .

See Also:
Serialized Form

Constructor Summary
DescExtractor()
          Creates a free text descriptive summary extractor.
 
Method Summary
 String extract(String keywords, String text)
           
 String extractField(edu.unika.aifb.kaon.Instance i, String text)
          Trawls through the text and concats relevant sentences together based on the target keywords specified.
 String getDescription()
          Returns a description of this extractor.
 String getExtractableField(edu.unika.aifb.kaon.Concept c)
          Returns the name of the relation (field) extracted by this FieldExtractor.
static void main(String[] argv)
          This routine tests the DescExtractor.
 
Methods inherited from class edu.stanford.nlp.ie.SingleFieldExtractor
extractField, extractFields, extractFields, getExtractableFields
 
Methods inherited from class edu.stanford.nlp.ie.AbstractFieldExtractor
isFieldExtractable, storeExtractor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DescExtractor

public DescExtractor()
Creates a free text descriptive summary extractor.

Method Detail

getExtractableField

public String getExtractableField(edu.unika.aifb.kaon.Concept c)
Returns the name of the relation (field) extracted by this FieldExtractor. Currently this is concept-independent, but that probably will change.

Specified by:
getExtractableField in class SingleFieldExtractor

getDescription

public String getDescription()
Returns a description of this extractor.

Specified by:
getDescription in interface FieldExtractor

extractField

public String extractField(edu.unika.aifb.kaon.Instance i,
                           String text)
Trawls through the text and concats relevant sentences together based on the target keywords specified. Returns the empty string if nothing is found.

Specified by:
extractField in class SingleFieldExtractor
Returns:
String biographical description, or the empty string

extract

public String extract(String keywords,
                      String text)

main

public static void main(String[] argv)
This routine tests the DescExtractor.
Usage: java DescExtractor [url] [search_term]
or: java DescExtractor -f [filename] [search_term]

Parameters:
argv - command arguments, as above


Stanford NLP Group