|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.illinois.cs.cogcomp.lbj.coref.parsers.BIOParser
public class BIOParser
Extracts examples of mention chunks, one per word, for training a mention detection classifier. Each example represents one word, and indicate whether the word begins, is inside, or ends a head and/or extent of a mention. The examples are extracted from a corpus of documents specified by providing a document loader. To extract examples, repeatedly call the next method until it returns null.
Field Summary | |
---|---|
protected java.util.List<Doc> |
m_docs
|
protected java.util.List<BIOExample> |
m_examples
|
protected int |
m_iD
|
protected int |
m_iX
|
private int |
m_numExamplesProcessed
|
Constructor Summary | |
---|---|
BIOParser(DocLoader loader)
Constructs a Parser that extracts examples from a corpus, with documents loaded by a specified document loader. |
Method Summary | |
---|---|
private void |
advanceDoc()
Prepares to extract examples from the next document (including resetting the document). |
protected void |
cleanup()
Called immediately before next returns null. |
void |
close()
|
void |
enqueue(java.lang.Object q)
Does nothing |
java.util.List<BIOExample> |
getBIOExamples(Doc d)
|
private BIOExample |
getNextExample()
Gets an example from the cache and prepares for the next example. |
BIOExample |
next()
Gets the next example, or null if no more examples remain. |
void |
reset()
Resets the parser to the first document in the corpus. |
private void |
resetDoc()
Resets the document, including caching the examples from the example extractor. |
protected void |
startup(DocLoader loader)
Prepares the parser, by loading documents and resetting the doc. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Doc> m_docs
protected java.util.List<BIOExample> m_examples
protected int m_iD
protected int m_iX
private int m_numExamplesProcessed
Constructor Detail |
---|
public BIOParser(DocLoader loader)
loader
- A document loader that loads a corpus of documents.Method Detail |
---|
public BIOExample next()
next
in interface LBJ2.parse.Parser
public void reset()
reset
in interface LBJ2.parse.Parser
public void close()
close
in interface LBJ2.parse.Parser
public void enqueue(java.lang.Object q)
q
- An arbitrary object.public java.util.List<BIOExample> getBIOExamples(Doc d)
private BIOExample getNextExample()
m_examples
is initialized and when m_iX
is less than the size of m_examples
private void advanceDoc()
private void resetDoc()
protected void startup(DocLoader loader)
loader
- The loader from which to get the documents.protected void cleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |