Complex Event Extraction
repository·master·Indexed 23 days ago
https://github.com/liuhuanyong/complexeventextractionA project for extracting Chinese compound events—including causal, conditional, sequential, and reversal events—to construct Event Graphs (Logic Graphs). It identifies event relationships through complex sentence structures and provides various representation methods using short sentences, word sequences, and phrases.
What's inside complexeventextraction
- ComplexEventExtraction is a project focused on Chinese compound event extraction. It identifies various types of events within Chinese text—such as conditional, causal, sequential, and reversal events—and organizes them into an Event Graph (also known as a Logic Graph or 事理图谱). The project leverages the fact that Chinese compound events are explicitly expressed through complex sentence structures.
Understand Event Representation Methods
masterThe project discusses three ways to represent events (using a causal event as an example: "African swine fever recently, leading to domestic pork price increases"):
- Short Sentences (短句): Uses Chinese punctuation as boundaries (e.g.,
这几天非洲闹猪瘟&国内猪肉涨价).- Pros: Easy, uses original information.
- Cons: High noise, difficult to fuse.
- Word Sequences (词序列): Performs word segmentation, POS tagging, and stop-word removal (e.g.,
非洲闹猪瘟&国内猪肉涨价).- Pros: Richer semantics, shorter than sentences.
- Cons: Stop-word rules are hard to control.
- Phrases (短语): Uses dependency parsing or semantic role labeling to form subject-predicate or verb-object phrases (e.g.,
非洲闹猪瘟&猪肉涨价).- Pros: Semantically condensed and concise.
- Cons: Limited by the performance of dependency/semantic role parsers.
- Short Sentences (短句): Uses Chinese punctuation as boundaries (e.g.,
Understand Event Graph (Logic Graph) Types
masterThe project categorizes events into four primary types based on their logical relationship and application:
Event Type Meaning Formalization Application Graph Scenario Causal Event (因果事件) One event leads to another A leads to B Event warning Causal tracing (finding cause from effect) Conditional Event (条件事件) One event occurs under certain conditions If A, then B Event warning Timing determination Reversal Event (反转事件) Two events are in opposition Although A, but B Risk prevention Negative examples Sequential Event (顺承事件) One event follows another A followed by B Event evolution Future intent recognition Reference patterns for Reversal Events in complex_sentence.py
masterThe project uses
complex_sentence.pyto define patterns for identifying event relationships. Below is the implementation of thepattern_butmethod which identifies reversal (but) patterns using specific word pairings:'''转折事件''' def pattern_but(self): wds = [[['与其'], ['不如'],'but'], [['虽然','尽管','虽'],['但也','但还','但却','但'],'but'], [['虽然','尽管','虽'],[ '但','但是也','但是还','但是却',],'but'], [['不是'],['而是'],'but'], [['即使','就算是'],['也','还'],'but'], [['即便'],['也','还'],'but'], [['虽然','即使'],['但是','可是','然而','仍然','还是','也', '但'],'but'], [['虽然','尽管','固然'],['也','还','却'],'but'], [['与其','宁可'],['决不','也不','也要'],'but'], [['与其','宁肯'],['决不','也要','也不'],'but'], [['与其','宁愿'],['也不','决不','也要'],'but'], [['虽然','尽管','固然'],['也','还','却'],'but'], [['不管','不论','无论','即使'],['都', '也', '总', '始终', '一直'],'but'], [['虽'],['可是','倒','但','可','却','还是','但是'],'but'], [['虽然','纵然','即使'],['倒','还是','但是','但','可是','可','却'],'but'], [['虽说'],['还是','但','但是','可是','可','却'],'but'], [['无论'],['都','也','还','仍然','总','始终','一直'],'but'], [['与其'],['宁可','不如','宁肯','宁愿'],'but'] ```'''转折事件''' def pattern_but(self): wds = [[['与其'], ['不如'],'but'], [['虽然','尽管','虽'],['但也','但还','但却','但'],'but'], [['虽然','尽管','虽'],[ '但','但是也','但是还','但是却',],'but'], [['不是'],['而是'],'but'], [['即使','就算是'],['也','还'],'but'], [['即便'],['也','还'],'but'], [['虽然','即使'],['但是','可是','然而','仍然','还是','也', '但'],'but'], [['虽然','尽管','固然'],['也','还','却'],'but'], [['与其','宁可'],['决不','也不','也要'],'but'], [['与其','宁肯'],['决不','也要','也不'],'but'], [['与其','宁愿'],['也不','决不','也要'],'but'], [['虽然','尽管','固然'],['也','还','却'],'but'], [['不管','不论','无论','即使'],['都', '也', '总', '始终', '一直'],'but'], [['虽'],['可是','倒','但','可','却','还是','但是'],'but'], [['虽然','纵然','即使'],['倒','还是','但是','但','可是','可','却'],'but'], [['虽说'],['还是','但','但是','可是','可','却'],'but'], [['无论'],['都','也','还','仍然','总','始终','一直'],'but'], [['与其'],['宁可','不如','宁肯','宁愿'],'but']