CoolFace
Modelpublic

CascadeNER/models_for_CascadeNER

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
Model Card

DynamicNER: A Dynamic, Multilingual, and Fine-Grained Dataset for LLM-based Named Entity Recognition

This repository is supplement material for the paper: DynamicNER: A Dynamic, Multilingual, and Fine-Grained Dataset for LLM-based Named Entity Recognition

πŸ’“Update!

  • β€”DynamicNER is disclosed now! Please download it from Huggingface for train and evaluation!
  • β€”We add more GEIC format existing datasets and also the format for fine-tuning and inferrence based on SWIFT! You can test CascadeNER easier!
  • β€”We provide a demo.py now. You can test your own sentence in a very simple way!
  • β€”We discover a problem that as SWIFT has been updated and some parameters has been changed, so please use the old version (according to requirements.txt)

πŸ“š Features

  • β€”This repository includes CascadeNER and DynamicNER, our NER framework and our dataset
  • β€”DynamicNER is the first dataset specially designed for NER with LLMs with a novel dynamic categorization system. It's multilingual and fine-grained.
  • β€”CascadeNER is the first universal and multilingual NER framework with SLMs, which supports both few-shot and zero-shot scenarios and achieves SOTA performance on low-resource and fine-grained datasets

πŸ“ˆ Quantitive Result:

<p align="center"> <img src="figure/dynamic.png" width="90%"/> </p>

πŸ“Œ Prerequisites

  1. 1.conda create -n cascadener python=3.10
  2. 2.pip install -r requirements.txt
  3. 3.You may also use a standard environment for SWIFT.
  4. 4.Download the fine-tuned extractor and classifier, and place them into the corresponding paths. Both models are fine-tuned based on QWEN2.5.
  5. 5.You may also download DynamicNER and other GEIC format dataset to train your own model.

🌟 Usage

  • β€”Train: please use SWIFT for model training. We strongly recommend Qwen2.5 for your base models. You may use follow the examples in any train.json from GEIC format dataset in huggingface to get the format of train sets. We now provide a example in ./DynamicNER/example.json
  • β€”First, prepare your own dataset for infer and use ./DynamicNER/transformation/stage1_trans.py to get input file for inferrence. You may also use the datasets we provided in GEIC format.
  • β€”Second, change your own paths in infer.py and extract.sh, including two model paths, dataset path, category path, and output path.
  • β€”Last, run infer.py and your will receive the results.
  • β€”Eval: If you want to evaluate our framework, please use evaluate.py. You can use the dataset in GEIC format other the results to evaluate.
  • β€”PS: Due to the update of SWIFT, you may need to use the old version to directly use our code, or you can modify the code slightly with the guidance from SWIFT. We will later provide a updated version of code for this problem.

❀️ Acknowledgement

  • β€”We thank QwenLM for opening source their Qwen model for us
  • β€”We thank ModelScope for opening source their SWIFT framework for us
  • β€”We thank teams of CoNLL2003, CrossNER, FewNERD, MultiCoNER and PAN-X for opening source their datasets