MCPcopy Index your code
hub / github.com/RingBDStack/GDAP

github.com/RingBDStack/GDAP @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
191 symbols 535 edges 24 files 47 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GDAP

Code for Generating Disentangled Arguments with Prompts: A Simple Event Extraction Framework that Works

Environment

  • Python (verified: v3.8)
  • CUDA (verified: v11.1)
  • Packages (see requirements.txt)

Usage

Preprocessing

We follow dygiepp for data preprocessing.

  • text2et: Event Type Detection
  • ettext2tri: Trigger Extraction
  • etrttext2role: Argument Extraction
# data processed by dyieapp
data/text2target/dyiepp_ace1005_ettext2tri_subtype
├── event.schema 
├── test.json
├── train.json
└── val.json

# data processed by  data_convert.convert_text_to_target
data/text2target/dyiepp_ace1005_ettext2tri_subtype
├── event.schema
├── test.json
├── train.json
└── val.json

Useful commands:

python -m data_convert.convert_text_to_target # data/raw_data -> data/text2target
python convert_dyiepp_to_sentence.py data/raw_data/dyiepp_ace2005 # doc -> sentence, used in evaluation

Training

Relevant scripts:

  • run_seq2seq.py: Python code entry, modified from the transformers/examples/seq2seq/run_seq2seq.py
  • run_seq2seq_span.bash: Model training script logging to the log file.

Example (see the above two files for more details):

# ace05 event type detection t5-base, the metric_format use eval_trigger-F1 
bash run_seq2seq_span.bash --data=dyiepp_ace2005_text2et_subtype --model=t5-base --format=et --metric_format=eval_trigger-F1

# ace05 tri extraction t5-base
bash run_seq2seq_span.bash --data=dyiepp_ace2005_ettext2tri_subtype --model=t5-base --format=tri --metric_format=eval_trigger-F1

# ace05 argument extraction t5-base
bash run_seq2seq_span.bash --data=dyiepp_ace2005_etrttext2role_subtype --model=t5-base --format=role --metric_format=eval_role-F1

Trained models are saved in the models/ folder.

The event type detection use the same output format and metric_format as trigger extraction, so the et exp result is included in eval_trigger- and test_trigger- of the log.

Evaluation

  • run_tri_predict.bash: trigger extraction evaluation and inference script.
  • run_arg_predict.bash: argument extraction evaluation and inference script.

If you find this repo helpful...

Please give us a :star: and cite our paper as

@inproceedings{si2021-GDAP,
      title={Generating Disentangled Arguments with Prompts: A Simple Event Extraction Framework that Works}, 
      author={Jinghui Si and Xutan Peng and Chen Li and Haotian Xu and Jianxin Li},
      booktitle={IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)}, 
      year={2022}
}

This project borrows code from Text2Event

Core symbols most depended-on inside this repo

lmap
called by 7
seq2seq/utils.py
freeze_params
called by 7
seq2seq/utils.py
read_from_file
called by 6
extraction/event_schema.py
clean_text
called by 6
extraction/predict_parser/target_predict_parser.py
read_file
called by 5
evaluation.py
get_label_name_tree
called by 5
extraction/label_tree.py
count_instance
called by 4
evaluation.py
generated_search_src_sequence
called by 4
extraction/extract_constraint.py

Shape

Function 82
Method 79
Class 30

Languages

Python100%

Modules by API surface

seq2seq/utils.py63 symbols
extraction/extract_constraint.py22 symbols
extraction/predict_parser/target_predict_parser.py18 symbols
seq2seq/constrained_seq2seq.py13 symbols
evaluation.py11 symbols
run_seq2seq.py9 symbols
extraction/predict_parser/predict_parser.py9 symbols
data_convert/task_format/event_extraction.py9 symbols
data_convert/format/text2target.py9 symbols
extraction/label_tree.py6 symbols
extraction/event_schema.py5 symbols
data_convert/utils.py5 symbols

For agents

$ claude mcp add GDAP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact