|
Download README.md from dileepa/hate_speech_classification: direct link, hf CLI and curl.
- Browser
- Download file 763 Bytes
-
https://huggingface.co/dileepa/hate_speech_classification/resolve/main/README.md
- Command line
-
hf download hf://dileepa/hate_speech_classification/README.md
-
curl -L -o README.md https://huggingface.co/dileepa/hate_speech_classification/resolve/main/README.md
763 Bytes
| # Hate Speech Classification Model Guide | |
| ## Introduction | |
| This document provides instructions for importing and using the hate speech classification model from Hugging Face in a Google Colab environment. | |
| --- | |
| ## Steps for Setup | |
| ### 1. Import Necessary Libraries | |
| ```python | |
| import tensorflow as tf | |
| import tensorflow_hub as hub | |
| ``` | |
| ### 2. Clone the Model Repository | |
| `!git clone https://huggingface.co/dileepa/hate_speech_classification` | |
| ### 3. Load the Pre-trained Model | |
| ``` | |
| cnn_model = tf.keras.models.load_model( | |
| 'hate_speech_classification/model.h5', | |
| custom_objects={'KerasLayer': hub.KerasLayer} | |
| ) | |
| ``` | |
| ### 4. Example Usage | |
| ``` | |
| # Test prediction | |
| sample_text = "Insert your text here" | |
| result = cnn_model.predict([sample_text]) | |
| print(result) | |
| ``` | |