dnzblgn commited on
Commit
146c383
1 Parent(s): 041750b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -1
README.md CHANGED
@@ -1 +1,54 @@
1
- trial
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ {}
3
+ ---
4
+
5
+ # BERT Text Classification
6
+
7
+ This is a BERT-based text classification model trained on the "socialmedia-disaster-tweets" dataset. It performs sentiment analysis to classify tweets as "Relevant" or "Not Relevant" to a disaster event.
8
+
9
+ ## Model Description
10
+
11
+ The model uses the BERT (Bidirectional Encoder Representations from Transformers) architecture to generate embeddings for the input text. These embeddings are then fed into a sequential Keras model with a dense hidden layer and a sigmoid output layer for binary classification.
12
+
13
+ ## Intended Use
14
+
15
+ This model is intended to be used for text classification on short text snippets, specifically tweets related to disaster events. It can help in identifying relevant tweets for further analysis and response.
16
+
17
+ ## Limitations and Ethical Considerations
18
+
19
+ - The model's performance heavily relies on the quality and representativeness of the training data. If the training data is biased or limited, the model's predictions may be biased or inaccurate.
20
+ - The model may not generalize well to tweets from domains or topics that significantly differ from the training data.
21
+ - Text classification models may not capture the full complexity of human sentiment and can be sensitive to variations in language use.
22
+ - It's important to use the model as a tool to aid human decision-making rather than relying solely on its predictions. Human review and context awareness are essential in interpreting and acting upon the model's output.
23
+
24
+ ## Usage
25
+
26
+ Here's an example of how to use the model for inference:
27
+
28
+ ```python
29
+ from transformers import TFAutoModel, AutoTokenizer
30
+ import tensorflow as tf
31
+ import numpy as np
32
+
33
+ # Load the pre-trained model and tokenizer
34
+ model = TFAutoModel.from_pretrained("dnzblgn/BERT_Text_Classification")
35
+ tokenizer = AutoTokenizer.from_pretrained("dnzblgn/BERT_Text_Classification")
36
+
37
+ # Preprocess the input sentence
38
+ input_sentence = " Horrible Accident | Man Died In Wings of AirplaneåÊ(29-07-2015)"
39
+ input_sentence = tokenizer.encode_plus(
40
+ input_sentence,
41
+ add_special_tokens=True,
42
+ max_length=768,
43
+ padding="longest",
44
+ truncation=True,
45
+ return_attention_mask=True,
46
+ return_tensors="tf",
47
+ )
48
+
49
+ # Make the prediction
50
+ prediction = model.predict(input_sentence)[0][0]
51
+ label = "Relevant" if prediction == 0 else "Not Relevant"
52
+
53
+ print("Input Sentence:", input_sentence)
54
+ print("Prediction:", label)