Downloads · 30 days
0
telecomsxchange/OTS
OTS is a text classification model from telecomsxchange. Use it when you need a label for a piece of text. It is set up for fasttext, bert. The card lists the license as mit.
OTS (Open Source Text Shield) is an AI-driven solution designed to enhance the security of telecom networks by detecting and filtering spam and phishing messages in real time. This application leverages both BERT and…
Downloads · 30 days
0
Access
Public
Updated Feb 2, 2024
Repo size
1.2 GB
Likes
1
Public
Click a slice to open those files.
.bin811 MB · 65%
From the Hugging Face model README
OTS (Open Source Text Shield) is an AI-driven solution designed to enhance the security of telecom networks by detecting and filtering spam and phishing messages in real time. This application leverages both BERT and FastText models for efficient text classification.
You can install the necessary libraries using pip:
pip install fastapi pydantic torch transformers fasttext
Clone the repository to your local machine:
git clone https://github.com/TelecomsXChangeAPi/OpenTextShield/
Navigate to the cloned directory:
cd OpenTextShield
Start the server by running:
uvicorn main:app --host 0.0.0.0 --port 8001
The application will be available at http://localhost:8001.
To predict if an SMS is spam, phishing, or ham (regular message), send a POST request to /predict/ with a JSON body containing the SMS text and the model to use (bert or fasttext).
Example using curl:
curl -X POST "http://localhost:8001/predict/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"text\":\"Your SMS content here\",\"model\":\"bert\"}"
To provide feedback on predictions, send a POST request to /feedback-loop/ with relevant feedback data.
Example using curl:
curl -X POST "http://localhost:8001/feedback-loop/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"content\":\"SMS content\",\"feedback\":\"Your feedback here\",\"thumbs_up\":true,\"thumbs_down\":false,\"user_id\":\"user123\",\"model\":\"bert\"}"
To download the feedback data for a specific model, send a GET request to /download-feedback/{model_name}.
Example using curl:
curl -X GET "http://localhost:8001/download-feedback/bert"
Special thanks to the team at TelecomsXChange (TCXC) for their invaluable contributions to this project.