Text Classification
Scikit-learn
English
Shinapri commited on
Commit
a498c14
·
verified ·
1 Parent(s): 781424d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ metrics:
6
+ - name: exact_match
7
+ value: 0.9777
8
+ verified: false
9
+ pipeline_tag: text-classification
10
+ library_name: sklearn
11
+ ---
12
+ # WITTR or Wait, Is That The References?
13
+ A lightweight Naive Bayes classifier
14
+ designed to detect whether a given text should be **filtered out** from an academic paper
15
+ before being used for **language-model pretraining** or **RAG (Retrieval-Augmented Generation)**.
16
+
17
+ ---
18
+
19
+ ## 🧠 Concept
20
+
21
+ WITTR is trained on text from academic and research-style corpora.
22
+ It distinguishes between two main categories:
23
+
24
+ - ✅ **0** – meaningful content such as main academic paragraphs, analysis, or discussion
25
+ - ❌ **1** – metadata or non-content text such as author names, URLs, DOIs, references, publication years, or institutional names
26
+
27
+ The goal is to provide an **automatic corpus-cleaning step**
28
+ that keeps only the informative text suitable for model training.
29
+
30
+ ---
31
+
32
+ ## ⚙️ Model Details
33
+
34
+ - **Framework:** scikit-learn
35
+ - **Architecture:** Multinomial Naive Bayes
36
+ - **Vectorization:** TF–IDF
37
+ - **Language:** English academic text
38
+ - **Accuracy:** ≈ 0.9777
39
+ - **Intended Use:** academic text preprocessing, corpus filtering before LLM or RAG pipelines
40
+
41
+ ---
42
+
43
+ ## 📦 Files
44
+
45
+ | File | Description |
46
+ |------|--------------|
47
+ | `wittr_naive.pkl` | Trained Naive Bayes classifier |
48
+ | `wittr_naive_vectorizer.pkl` | TF–IDF vectorizer (must be used with the model) |
49
+ | `wittr_naive.py` | Simple python script |
50
+ | `README.md` | This documentation |
51
+
52
+ ---
53
+
54
+ ## 🚀 Usage Example
55
+
56
+ ```python
57
+ from huggingface_hub import hf_hub_download
58
+ import joblib
59
+
60
+ repo = "Lucanix/wittr"
61
+
62
+ clf = joblib.load(hf_hub_download(repo, "wittr_naive.pkl"))
63
+ vectorizer = joblib.load(hf_hub_download(repo, "wittr_naive_vectorizer.pkl"))
64
+
65
+ text = ["18 Bales G. S. & and Chrzan, D. C. Dynamics of irreversible island growth during submonolayer epitaxy. *Phys. Rev. B* **50**, 6057–6067 (1994)."]
66
+ X = vectorizer.transform(text)
67
+ print(clf.predict(X)) # → [1]
68
+ ```