Improve dataset card for NLP-ADBench: Add metadata, links, overview, sample usage, and citation

#3
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +91 -2
README.md CHANGED
@@ -1,5 +1,94 @@
1
  ---
2
- license: mit
3
  language:
4
  - en
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  language:
3
  - en
4
+ license: mit
5
+ task_categories:
6
+ - text-classification
7
+ tags:
8
+ - anomaly-detection
9
+ - nlp
10
+ ---
11
+
12
+ # NLP-ADBench: NLP Anomaly Detection Benchmark
13
+
14
+ **Paper:** [NLP-ADBench: NLP Anomaly Detection Benchmark](https://huggingface.co/papers/2412.04784)
15
+ **Code:** [https://github.com/USC-FORTIS/NLP-ADBench](https://github.com/USC-FORTIS/NLP-ADBench)
16
+
17
+ ## Overview
18
+
19
+ **NLP-ADBench** is a comprehensive benchmarking tool designed for Anomaly Detection in Natural Language Processing (NLP). It not only establishes a benchmark but also introduces the NLPAD datasets—8 curated and transformed datasets derived from existing NLP classification datasets. These datasets are specifically tailored for NLP anomaly detection tasks and presented in a unified standard format to support and advance research in this domain.
20
+
21
+ To ensure a robust evaluation, NLP-ADBench includes results from 19 algorithms applied to the 8 NLPAD datasets, categorized into two groups:
22
+ - 3 end-to-end algorithms that directly process raw text data to produce anomaly detection outcomes.
23
+ - 16 embedding-based algorithms, created by applying 8 traditional anomaly detection methods to text embeddings generated using two models:
24
+ - BERT's `bert-base-uncased`(**BERT**)
25
+ - OpenAI’s `text-embedding-3-large`(**OpenAI**).
26
+
27
+
28
+ ![Performance comparison of 19 Algorithms on 8 NLPAD datasets using AUROC](https://github.com/USC-FORTIS/NLP-ADBench/blob/main/figs/benchmark.png)
29
+
30
+ ## NLPAD Datasets
31
+
32
+ The datasets required for this project can be downloaded from the following Hugging Face links:
33
+
34
+ 1. **NLPAD Datasets**: These are the datasets mentioned in NLP-ADBench paper. You can download them from:
35
+
36
+ - [NLP-AD Datasets](https://huggingface.co/datasets/kendx/NLP-ADBench/tree/main/datasets)
37
+
38
+ 2. **Pre-Extracted Embeddings**: For embedding-based algorithms, we have already extracted these embeddings. If you want to use them directly, you can download them from:
39
+
40
+ - [Pre-Extracted Embeddings](https://huggingface.co/datasets/kendx/NLP-ADBench/tree/main/embeddings)
41
+
42
+ ## Sample Usage
43
+
44
+ ### Environment Setup Instructions
45
+
46
+ Follow these steps to set up the development environment using the provided Conda environment file:
47
+
48
+ 1. **Install Anaconda or Miniconda**:
49
+ Download and install Anaconda or Miniconda from [here](https://docs.conda.io/en/latest/miniconda.html).
50
+
51
+ 2. **Create the Environment**:
52
+ Using the terminal, navigate to the directory containing the `environment.yml` file (found in the [GitHub repository](https://github.com/USC-FORTIS/NLP-ADBench)) and run:
53
+ ```bash
54
+ conda env create -f environment.yml
55
+ ```
56
+ 3. **Activate the Environment**:
57
+ Activate the newly created environment using:
58
+ ```bash
59
+ conda activate nlpad
60
+ ```
61
+
62
+ ### Import data
63
+
64
+ Get `Pre-Extracted Embeddings` data from the [huggingface link](https://huggingface.co/datasets/kendx/NLP-ADBench/tree/main/embeddings) and put it in the data folder.
65
+
66
+ Place all downloaded embeddings data into the `feature` folder in the `./benchmark` directory of this project.
67
+
68
+ ### Run the code
69
+ Run the following commands from the `./benchmark` directory of the project (after cloning the [GitHub repository](https://github.com/USC-FORTIS/NLP-ADBench)):
70
+
71
+ #### BERT
72
+ If you want to run a benchmark using data embedded with BERT's `bert-base-uncased` model, use this command:
73
+ ````bash
74
+ python [algorithm_name]_benchmark.py bert
75
+ ````
76
+
77
+ #### OpenAI
78
+ If you want to run a benchmark using data embedded with OpenAI's `text-embedding-3-large` model, use this command:
79
+ ````bash
80
+ python [algorithm_name]_benchmark.py gpt
81
+ ````
82
+
83
+ ## Citation
84
+
85
+ If you find this work useful, please cite our paper:
86
+
87
+ ```bibtex
88
+ @article{li2025nlp,
89
+ title={Nlp-adbench: Nlp anomaly detection benchmark},
90
+ author={Li, Yuangang and Li, Jiaqi and Xiao, Zhuo and Yang, Tiankai and Nian, Yi and Hu, Xiyang and Zhao, Yue},
91
+ journal={Findings of the Association for Computational Linguistics: EMNLP 2025},
92
+ year={2025}
93
+ }
94
+ ```