Skip to content

Commit 08fc5b3

Browse files
removed extra files
1 parent f446d4a commit 08fc5b3

19 files changed

+2
-1783
lines changed

model.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,11 @@
1010
from keras.preprocessing.text import Tokenizer
1111
from keras.preprocessing.sequence import pad_sequences
1212
from sklearn.preprocessing import LabelEncoder
13-
import re
14-
1513
import pickle
1614

17-
1815
nltk.download('stopwords')
1916
nltk.download('punkt')
2017

21-
# def preprocess_text(text):
22-
# # Remove punctuation, convert to lowercase
23-
# # text = ''.join([char.lower() for char in text if char.isalnum() and not char.isdigit() or char.isspace()])
24-
# text = ''.join([char.lower() for char in text if char.isalnum() or char.isspace()])
25-
26-
# # Tokenization
27-
# tokens = word_tokenize(text)
28-
29-
# # Remove stopwords
30-
# stop_words = set(stopwords.words('english'))
31-
# tokens = [word for word in tokens if word not in stop_words]
32-
33-
# # Stemming
34-
# stemmer = PorterStemmer()
35-
# tokens = [stemmer.stem(word) for word in tokens]
36-
37-
# return ' '.join(tokens)
3818

3919
def preprocess_text(text):
4020
# Convert to lowercase
@@ -180,19 +160,4 @@ def custom_sparse_softmax_cross_entropy(labels, logits):
180160
# Train the model
181161
model.fit(padded_sequences, labels_np, epochs=100)
182162
# Save the model in the recommended Keras format
183-
model.save('trained_model.keras')
184-
185-
186-
# One-hot encode labels (assuming labels are text strings)
187-
# label_encoder = LabelEncoder()
188-
# labels_encoded = label_encoder.fit_transform(labels)
189-
# labels_onehot = tf.keras.utils.to_categorical(labels_encoded, num_classes=len(set(labels))) # Adjust num_classes if needed
190-
191-
# # Compile the model with categorical crossentropy loss
192-
# model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy', 'precision', 'recall'])
193-
194-
# # Train the model
195-
# model.fit(padded_sequences, labels_onehot, epochs=100)
196-
197-
# # Save the model
198-
# model.save('trained_model.keras')
163+
model.save('trained_model.keras')

ner.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

runmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ def custom_sparse_softmax_cross_entropy(labels, logits):
7373
# Check relevance and print the result
7474
is_relevant = any(score >= similarity_threshold for score in similarity_scores)
7575
relevance_status = "Relevant" if is_relevant else "Irrelevant"
76-
print(f"Text: {text} | Predicted Label: {predicted_class_labels[0]} | Relevance: {relevance_status}")
76+
print(f"Text: {text} | Predicted Label: {predicted_class_labels[0]} | Relevance: {relevance_status}")

testmodels/testing1.py

Lines changed: 0 additions & 101 deletions
This file was deleted.

tokenizer.pkl

-5.14 KB
Binary file not shown.

tokenizer_config.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

trained_model.keras

-721 KB
Binary file not shown.

trained_ner_model/config.cfg

Lines changed: 0 additions & 130 deletions
This file was deleted.

trained_ner_model/meta.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)