Update README.md
Browse files
README.md
CHANGED
|
@@ -27,7 +27,7 @@ from huggingface_hub import hf_hub_download
|
|
| 27 |
import fasttext
|
| 28 |
|
| 29 |
|
| 30 |
-
model_hf = fasttext.load_model(hf_hub_download("kenhktsui/code-natural-language-fasttext-classifier", "model.bin"))
|
| 31 |
|
| 32 |
|
| 33 |
def replace_newlines(text: str) -> str:
|
|
@@ -51,6 +51,7 @@ predict([
|
|
| 51 |
# {'label': 'Code', 'score': 1.000009}]
|
| 52 |
```
|
| 53 |
## 📊Evaluation
|
|
|
|
| 54 |
```
|
| 55 |
precision recall f1-score support
|
| 56 |
|
|
@@ -62,6 +63,18 @@ NaturalLanguage 1.00 0.92 0.95 228993
|
|
| 62 |
weighted avg 0.98 0.98 0.98 810275
|
| 63 |
```
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
## 📝Definition of Label
|
| 67 |
Code covers:
|
|
|
|
| 27 |
import fasttext
|
| 28 |
|
| 29 |
|
| 30 |
+
model_hf = fasttext.load_model(hf_hub_download("kenhktsui/code-natural-language-fasttext-classifier", "model.bin")) # "model_quantized.bin" for quantized version
|
| 31 |
|
| 32 |
|
| 33 |
def replace_newlines(text: str) -> str:
|
|
|
|
| 51 |
# {'label': 'Code', 'score': 1.000009}]
|
| 52 |
```
|
| 53 |
## 📊Evaluation
|
| 54 |
+
full version
|
| 55 |
```
|
| 56 |
precision recall f1-score support
|
| 57 |
|
|
|
|
| 63 |
weighted avg 0.98 0.98 0.98 810275
|
| 64 |
```
|
| 65 |
|
| 66 |
+
quantized version
|
| 67 |
+
```
|
| 68 |
+
precision recall f1-score support
|
| 69 |
+
|
| 70 |
+
Code 0.95 1.00 0.97 581282
|
| 71 |
+
NaturalLanguage 1.00 0.86 0.93 228993
|
| 72 |
+
|
| 73 |
+
micro avg 0.96 0.96 0.96 810275
|
| 74 |
+
macro avg 0.97 0.93 0.95 810275
|
| 75 |
+
weighted avg 0.96 0.96 0.96 810275
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
|
| 79 |
## 📝Definition of Label
|
| 80 |
Code covers:
|