qiuhuachuan commited on
Commit
2bdc356
1 Parent(s): 546f006

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +79 -3
README.md CHANGED
@@ -1,3 +1,79 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+ <h1>
3
+ Facilitating NSFW Text Detection in Open-Domain Dialogue Systems via Knowledge Distillation
4
+ </h1>
5
+ </div>
6
+
7
+ <p align="center">
8
+ 📄 <a href="https://arxiv.org/pdf/2309.09749v2.pdf" target="_blank">Paper</a> •
9
+ 🤗 <a href="" target="_blank">Dataset</a> •
10
+ 🛠️ <a href="https://huggingface.co/qiuhuachuan/CensorChat" target="_blank">Model</a>
11
+ </p>
12
+
13
+ ## Overview
14
+
15
+ _CensorChat_ is a dialogue monitoring dataset aimed at NSFW dialogue detection. Leveraging knowledge distillation techniques involving GPT-4 and ChatGPT, this dataset offers a cost-effective means of constructing NSFW content detectors. The process entails collecting real-life human-machine interaction data and breaking it down into single utterances and single-turn dialogues, with the chatbot delivering the final utterance. ChatGPT is employed to annotate unlabeled data, serving as a training set. Rationale validation and test sets are constructed using ChatGPT and GPT-4 as annotators, with a self-criticism strategy for resolving discrepancies in labeling. A BERT model is fine-tuned as a text classifier on pseudo-labeled data, and its performance is assessed.
16
+
17
+ <p align="center"> <img src="assets/proposed_methodology.png" style="width: 70%;" id="title-icon"></p>
18
+
19
+ ## Data Collection
20
+
21
+ - NSFW text in dialogues refers to text-based communication that contains **sexually explicit language, violence, profanity, hate speech, or suggestive content** that is not suitable for beneficial and healthy dialogue platforms.
22
+
23
+ - We collect data from a popular social media platform for personal dialogue that allows people to engage in deep discussions about life, aspirations, and philosophy with renowned virtual figures.
24
+
25
+ - we propose extracting the dialogue into two data formats: utterance-level and context-level content. For utterance-level content, we split the dialogue into utterances, consisting of $\{u_i\}_1^n$, based on the speaker's perspective. For context-level content, we divide the dialogue into single-turn sessions, consisting of $\{u_i^\mathrm{U}, u_i^\mathrm{C}\}_1^n$, where users initiate the conversation and bots respond. $u$ denotes the utterance. $\mathrm{U}$ and $\mathrm{C}$ denote the user and chatbot, respectively.
26
+
27
+ ## Algorithm
28
+
29
+ Text classification with BERT model via knowledge distillation is shown below:
30
+
31
+ <p align="center"> <img src="assets/algorithm.png" style="width: 70%;" id="title-icon"></p>
32
+
33
+ ## Data Annotation
34
+
35
+ - NSFW: whether a response is NSFW or not (a binary label).
36
+
37
+ ### Cohen's Kappa
38
+
39
+ Cohen's kappa for valid and test set is shown below:
40
+
41
+ <p align="center"> <img src="assets/kappa.png" style="width: 100%;" id="title-icon"></p>
42
+
43
+ ### Data Statistics
44
+
45
+ Data statistics is shown below:
46
+
47
+ <p align="center"> <img src="assets/data_statistics.png" style="width: 85%;" id="title-icon"></p>
48
+
49
+ ### Examples
50
+
51
+ We present some examples in our dataset as follows:
52
+
53
+ <p align="center"> <img src="assets/examples.png" style="width: 100%;" id="title-icon"></p>
54
+
55
+ ## Model Performance
56
+
57
+ We report the classification results of the BERT model in the following table. We observe that the trained classifier can better detect the NSFW category, achieving a precision of 0.59 and a recall of 0.96. This indicates that there are some NSFW instances predicted as SFW, as well as fewer SFW instances predicted as NSFW. Moreover, our classifier achieves an accuracy of 0.91, demonstrating its greater practicality.
58
+
59
+ <p align="center"> <img src="assets/results.png" style="width: 80%;" id="title-icon"></p>
60
+
61
+ ## Usage
62
+
63
+ **NOTICE:** You can directly use our trained checkpoint on the hub of Hugging Face.
64
+
65
+ ## Citation
66
+
67
+ If our work is useful for your own, you can cite us with the following BibTex entry:
68
+
69
+ ```bibtex
70
+ @article{qiu2023facilitating,
71
+ title={Facilitating NSFW Text Detection in Open-Domain Dialogue Systems via Knowledge Distillation},
72
+ author={Huachuan Qiu and Shuai Zhang and Hongliang He and Anqi Li and Zhenzhong Lan},
73
+ year={2023},
74
+ eprint={2309.09749},
75
+ archivePrefix={arXiv},
76
+ primaryClass={cs.CL},
77
+ url={https://arxiv.org/abs/2309.09749}
78
+ }
79
+ ```