Package relations

Class EventExtraction


  • public class EventExtraction
    extends Object
    Author:
    Chinh Date: 22 - 08 - 2011 Extracting event from sentence
    • Field Detail

      • prepSet

        public static final Set<String> prepSet
      • ccList

        public static final String[] ccList
      • prepList

        public static final String[] prepList
      • ccSet

        public static final Set<String> ccSet
    • Constructor Detail

      • EventExtraction

        public EventExtraction​(DBUtils sr,
                               DBUtils db)
        Extract event from the given data
        Parameters:
        db -
    • 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 trgs
        preps - : preposition list
        mods - : modifier words
        tokens - : list of words/tokens
        Trgs - : 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:
      • 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 - : BasicChunk
        tg - : trg
        ls - : 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 - : BasicChunk
        tg - : trg
        pros - :list of pro
        ls - : 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 - : trigger
        ls - : Basic Chunk
        Returns:
        : list of pros
      • getInChunkPro

        public List<Word> getInChunkPro​(BasicChunk bs,
                                        Word tg)
        11.10.2011. Checked!
        Parameters:
        bs - : BasicChunk
        tg - : 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 - : BasicChunk
        tg - : trig
        prep - :prep
        len - : 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 - : BasicChunk
        start - : start position
        len - : 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 - : BasicChunk
        start - : start position
        len - : 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 - : BasicChunk
        tg - : trig
        prep - :prep
        len - : 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 after Test() or Test(String) has been run. Contains the words identified as being triggers.
        Returns:
      • getExtractedEvents

        public Set<PData> getExtractedEvents()
        Available after Test() or Test(String) has been run. Contains identified events mentions.
        Returns:
      • main

        public static void main​(String[] args)
      • setDb

        public void setDb​(DBUtils docDb)