edu.washington.cs.knowitall.extraction
Class RelationExtraction

java.lang.Object
  extended by edu.washington.cs.knowitall.extraction.RelationExtraction
All Implemented Interfaces:
TokenSequence, XmlSerializable, Serializable

public class RelationExtraction
extends Object
implements TokenSequence, Serializable, XmlSerializable

A relation extraction.

Author:
schmmd
See Also:
Serialized Form

Constructor Summary
RelationExtraction(Sentence source, edu.washington.cs.knowitall.nlp.extraction.ChunkedBinaryExtraction extraction)
           
RelationExtraction(Sentence source, edu.washington.cs.knowitall.nlp.extraction.ChunkedBinaryExtraction extraction, String predString, String arg1String, String arg2String)
           
RelationExtraction(Sentence source, Long id, PredicateExtraction predicate, ArgumentExtraction argument1, ArgumentExtraction argument2)
           
RelationExtraction(Sentence source, PredicateExtraction predicate, ArgumentExtraction argument1, ArgumentExtraction argument2)
           
 
Method Summary
 ArgumentExtraction arg1()
          The first argument.
 ArgumentExtraction arg2()
          The second argument.
 boolean equals(Object that)
           
static RelationExtraction fromXmlElement(org.jdom.Element e, Sentence sentence)
           
 Iterable<String> getChunkTags()
           
 Long getId()
           
 Iterable<String> getLemmas()
           
 TokenSequence getPart(ExtractionPart part)
          Retrieve a TokenSequence that corresponds to the specified part.
 Iterable<String> getPosTags()
           
 edu.washington.cs.knowitall.commonlib.Range getRange()
          The range of the extraction.
 Sentence getSource()
           
 Iterable<String> getTokens()
           
 String getTokensAsString()
           
 Iterable<Type> getTypes()
           
 boolean isNegated()
           
 boolean isPassive()
          Determine if the extraction has the passive voice.
 Extraction left()
          An Extraction that covers the sentence to the left of this extraction.
 edu.washington.cs.knowitall.commonlib.Range leftRange()
          The range of the sentence to the left of the extraction.
 PredicateExtraction predicate()
          The predicate.
 Extraction right()
          An Extraction that covers the sentence to the right of this extraction.
 edu.washington.cs.knowitall.commonlib.Range rightRange()
          The range of the sentence to the right of the extraction.
 void tag(Iterable<Type> tags)
          Add types to this extraction if they overlap the expression's range.
 boolean tag(Type tag)
          Add type to this extraction if they overlap the expression's range.
 String toString()
           
 org.jdom.Element toXmlElement()
           
 Iterable<Type> types()
          The types associated with this extraction.
 List<Token> zip()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationExtraction

public RelationExtraction(Sentence source,
                          Long id,
                          PredicateExtraction predicate,
                          ArgumentExtraction argument1,
                          ArgumentExtraction argument2)

RelationExtraction

public RelationExtraction(Sentence source,
                          PredicateExtraction predicate,
                          ArgumentExtraction argument1,
                          ArgumentExtraction argument2)

RelationExtraction

public RelationExtraction(Sentence source,
                          edu.washington.cs.knowitall.nlp.extraction.ChunkedBinaryExtraction extraction)

RelationExtraction

public RelationExtraction(Sentence source,
                          edu.washington.cs.knowitall.nlp.extraction.ChunkedBinaryExtraction extraction,
                          String predString,
                          String arg1String,
                          String arg2String)
Method Detail

equals

public boolean equals(Object that)
Overrides:
equals in class Object

getSource

public Sentence getSource()

arg1

public ArgumentExtraction arg1()
The first argument.

Returns:

arg2

public ArgumentExtraction arg2()
The second argument.

Returns:

predicate

public PredicateExtraction predicate()
The predicate.

Returns:

leftRange

public edu.washington.cs.knowitall.commonlib.Range leftRange()
The range of the sentence to the left of the extraction.

Returns:

rightRange

public edu.washington.cs.knowitall.commonlib.Range rightRange()
The range of the sentence to the right of the extraction.

Returns:

getRange

public edu.washington.cs.knowitall.commonlib.Range getRange()
The range of the extraction.

Returns:

tag

public void tag(Iterable<Type> tags)
Add types to this extraction if they overlap the expression's range.

Parameters:
tags -

tag

public boolean tag(Type tag)
Add type to this extraction if they overlap the expression's range.

Parameters:
tags -

getTokensAsString

public String getTokensAsString()
Specified by:
getTokensAsString in interface TokenSequence

toString

public String toString()
Overrides:
toString in class Object

left

public Extraction left()
An Extraction that covers the sentence to the left of this extraction.

Returns:

right

public Extraction right()
An Extraction that covers the sentence to the right of this extraction.

Returns:

getPart

public TokenSequence getPart(ExtractionPart part)
Retrieve a TokenSequence that corresponds to the specified part.

Parameters:
part -
Returns:

isPassive

public boolean isPassive()
Determine if the extraction has the passive voice. The primary concern here is the argument order. If the sentence is passive, the arguments are reversed. For example: ...captain Ahab yelled at Stubbs... ...Stubbs was yelled at by Captain Ahab... The first example is active, the second example is passive. Note that in the first example, the sentence could still be passive. When captain Ahab yelled at Stubbs, Stubbs was hit by the mast.

Returns:

types

public Iterable<Type> types()
The types associated with this extraction.

Returns:

fromXmlElement

public static RelationExtraction fromXmlElement(org.jdom.Element e,
                                                Sentence sentence)

toXmlElement

public org.jdom.Element toXmlElement()
Specified by:
toXmlElement in interface XmlSerializable

getId

public Long getId()

getTokens

public Iterable<String> getTokens()
Specified by:
getTokens in interface TokenSequence

getLemmas

public Iterable<String> getLemmas()
Specified by:
getLemmas in interface TokenSequence

getChunkTags

public Iterable<String> getChunkTags()
Specified by:
getChunkTags in interface TokenSequence

getPosTags

public Iterable<String> getPosTags()
Specified by:
getPosTags in interface TokenSequence

getTypes

public Iterable<Type> getTypes()
Specified by:
getTypes in interface TokenSequence

zip

public List<Token> zip()
Specified by:
zip in interface TokenSequence

isNegated

public boolean isNegated()


Copyright © 2011 University of Washington CSE. All Rights Reserved.