agentlans/UltraX-line-classification
Viewer β’ Updated β’ 5.26M β’ 14
How to use agentlans/fasttext-line-classifier with fastText:
from huggingface_hub import hf_hub_download
import fasttext
model = fasttext.load_model(hf_hub_download("agentlans/fasttext-line-classifier", "model.bin"))A lightweight model built with FastText designed to evaluate individual lines of text and classify them as keep, delete, or edit to improve overall corpus quality.
This project is inspired by and based on an analysis of the UltraX project (it is not officially affiliated with it).
agentlans/openbmb-UltraX-Preview-line-classification. .ftz format) to significantly reduce file size and memory footprint while maintaining robust classification performance.agentlans/openbmb-UltraX-Preview-line-classification, achieving the following overall metrics:| Metric | Score | Sample Size (N) |
|---|---|---|
| Precision (@1) | 0.88 | 526238 |
| Recall (@1) | 0.88 | 526238 |
First, download the line_classifier.ftz file from this repository, then load and run predictions using Python:
import fasttext
# Load the model
model = fasttext.load_model("line_classifier.ftz")
# Test the model on sample text lines
texts = [
"You are the 100th visitor today! Claim your prize NOW!",
"This lecture series will examine the role of sweepstakes on consumer behaviour."
]
labels, probabilities = model.predict(texts)
print(labels)
print(probabilities)
| Line of Text | Prediction | Confidence |
|---|---|---|
Type: Whitepaper Poster |
delete |
0.4536 |
We now have FIVE dogs! I never thought I would have five dogs, but at least two are small dogs (the Boston Terriers β Guinness and Rollie) and two are calm senior dogs (Dusty and Tansy). [...] |
keep |
0.9354 |
The Gifu Prefecture on the main island of Honshu and the state of Baden-WΓΌrttemberg have long nurtured their political and economic ties... |
keep |
0.9527 |
## LIVE TICKET FOR 1 |
edit |
0.4407 |
Nclex Categories Breakdown |
delete |
0.8325 |
Distributed under the MIT License. See the LICENSE file for details.