Package relations
Class EventExtraction
- java.lang.Object
-
- relations.EventExtraction
-
public class EventExtraction extends Object
- Author:
- Chinh Date: 22 - 08 - 2011 Extracting event from sentence
-
-
Constructor Summary
Constructors Constructor Description EventExtraction(DBUtils sr, DBUtils db)Extract event from the given data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluateTrg(BasicChunk bs, List<Word> preps, List<Word> mods, String[] tokens, List<Word> Trgs)Evaluating candidate triggers whether they can form eventsList<PData>extractBindNP(Word tg, BasicChunk bc, List<Word> preps)12.10.2011 Extracting binding eventsList<PData>extractBindVP(Word tg, VerbChunk vc, List<Word> preps)voidextractEvents(String id)Extracting events from abstract/paragraph.List<PData>extractNP(int idx, BasicChunk bs, List<Word> preps)voidextractNP(BasicChunk bs, List<Word> preps)List<PData>extractRegNP(Word tg, BasicChunk bc, List<Word> preps)List<PData>extractRegVP(Word tg, VerbChunk vc, List<Word> preps)voidextractSentence(int i)List<PData>extractSimpleNP(Word tg, BasicChunk bc, List<Word> preps)Extracting simple event from BasicChunk with a given trigger (+type)List<PData>extractSimpleVP(Word tg, VerbChunk vc, List<Word> mods)Find pros for binding event which has pattern as: Pro1 - Trg - Pro2voidextractVP(VerbChunk vc, List<Word> preps, List<Word> mods)List<Word>findCausePro(BasicChunk bs, Word tg)Get Pro as cause for : PRO-xx TG PRO/EVENTList<Word>findFrontPro(BasicChunk bs, Word tg, int len)12.10.2011 Find pro in front of tg for noun phrase/subject patterns: PRO - TGList<Word>findPro(BasicChunk bs, int start, int len)Find pro after a given position (for use with tg- prep1 - prep2) Only looks for pro after prep2List<Word>findPro(BasicChunk bs, Word tg, String prep, int len)11.10.2011.List<Word>findRegPro(BasicChunk bs, Word tg, int start, int len)Find pro after a given position (for use with tg- prep1 - prep2) Only looks for pro after prep2Set<PData>getExtractedEvents()Available afterTest()orTest(String)has been run.Set<Word>getExtractedTriggers()Available afterTest()orTest(String)has been run.List<Word>getInChunkPro(BasicChunk bs, Word tg)11.10.2011.List<Word>getMod(int pos1, int pos2, List<Word> ls)Get modifier for trigger in order to determine trigger typeList<Word>getMod(BasicChunk bs, Word tg, List<Word> ls)Get modifier for trigger in order to determine trigger typeList<Word>getMod(BasicChunk bs, Word tg, List<Word> pros, List<Word> ls)Get modifier for trigger in order to determine trigger typeList<Word>getMod(Chunk c1, Chunk c2, List<Word> ls)Get modifier for trigger in order to determine trigger typeMap<String,RuleSets>groupRules(Map<String,Rules>[] map)voidinit()voidinitSentence(String id)static voidmain(String[] args)voidprintChunkList()voidsetDb(DBUtils docDb)voidTest()voidTest(String outPath)
-
-
-
Method Detail
-
init
public void init()
-
evaluateTrg
public void evaluateTrg(BasicChunk bs, List<Word> preps, List<Word> mods, String[] tokens, List<Word> Trgs)
Evaluating candidate triggers whether they can form events- Parameters:
bs- : BasicChunk contains trgspreps- : preposition listmods- : modifier wordstokens- : list of words/tokensTrgs- : detected TG (used to determine trg type)
-
extractSimpleNP
public List<PData> extractSimpleNP(Word tg, BasicChunk bc, List<Word> preps)
Extracting simple event from BasicChunk with a given trigger (+type)- Parameters:
tg-bc-preps-mods-- Returns:
-
extractBindNP
public List<PData> extractBindNP(Word tg, BasicChunk bc, List<Word> preps)
12.10.2011 Extracting binding events- Parameters:
bc-preps-mods-- Returns:
-
extractNP
public void extractNP(BasicChunk bs, List<Word> preps)
-
extractNP
public List<PData> extractNP(int idx, BasicChunk bs, List<Word> preps)
-
getMod
public List<Word> getMod(Chunk c1, Chunk c2, List<Word> ls)
Get modifier for trigger in order to determine trigger type- Parameters:
c1-c2-ls-- Returns:
-
getMod
public List<Word> getMod(int pos1, int pos2, List<Word> ls)
Get modifier for trigger in order to determine trigger type- Parameters:
ls- : list of modifiers
-
getMod
public List<Word> getMod(BasicChunk bs, Word tg, List<Word> ls)
Get modifier for trigger in order to determine trigger type- Parameters:
bs- : BasicChunktg- : trgls- : list of modifiers
-
getMod
public List<Word> getMod(BasicChunk bs, Word tg, List<Word> pros, List<Word> ls)
Get modifier for trigger in order to determine trigger type- Parameters:
bs- : BasicChunktg- : trgpros- :list of prols- : modifiers
-
extractSimpleVP
public List<PData> extractSimpleVP(Word tg, VerbChunk vc, List<Word> mods)
Find pros for binding event which has pattern as: Pro1 - Trg - Pro2- Parameters:
tg- : triggerls- : Basic Chunk- Returns:
- : list of pros
-
getInChunkPro
public List<Word> getInChunkPro(BasicChunk bs, Word tg)
11.10.2011. Checked!- Parameters:
bs- : BasicChunktg- : trigger- Returns:
- : list of protein that can use to form event
-
findPro
public List<Word> findPro(BasicChunk bs, Word tg, String prep, int len)
11.10.2011. Checked! Find pro for noun phrase patterns: TG - PRO- Parameters:
bs- : BasicChunktg- : trigprep- :preplen- : number of chunks
-
findCausePro
public List<Word> findCausePro(BasicChunk bs, Word tg)
Get Pro as cause for : PRO-xx TG PRO/EVENT- Parameters:
bs-tg-- Returns:
-
findPro
public List<Word> findPro(BasicChunk bs, int start, int len)
Find pro after a given position (for use with tg- prep1 - prep2) Only looks for pro after prep2- Parameters:
bs- : BasicChunkstart- : start positionlen- : distance to look for- Returns:
- : list of pros if found
-
findRegPro
public List<Word> findRegPro(BasicChunk bs, Word tg, int start, int len)
Find pro after a given position (for use with tg- prep1 - prep2) Only looks for pro after prep2- Parameters:
bs- : BasicChunkstart- : start positionlen- : distance to look for- Returns:
- : list of pros if found
-
findFrontPro
public List<Word> findFrontPro(BasicChunk bs, Word tg, int len)
12.10.2011 Find pro in front of tg for noun phrase/subject patterns: PRO - TG- Parameters:
bs- : BasicChunktg- : trigprep- :preplen- : number of chunks
-
initSentence
public void initSentence(String id)
-
extractSentence
public void extractSentence(int i)
-
printChunkList
public void printChunkList()
-
Test
public void Test(String outPath)
-
Test
public void Test()
-
extractEvents
public void extractEvents(String id)
Extracting events from abstract/paragraph.- Parameters:
id- : PMID (abstract/paragraph)
-
getExtractedTriggers
public Set<Word> getExtractedTriggers()
Available afterTest()orTest(String)has been run. Contains the words identified as being triggers.- Returns:
-
getExtractedEvents
public Set<PData> getExtractedEvents()
Available afterTest()orTest(String)has been run. Contains identified events mentions.- Returns:
-
main
public static void main(String[] args)
-
setDb
public void setDb(DBUtils docDb)
-
-