Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ bad_words = load_bad_words('badwords.txt') # Adjust the path to your bad words
|
|
25 |
topics_list = ['Aviation', 'Science', 'Education', 'Air Force Pilot', 'Space Exploration', 'Technology']
|
26 |
|
27 |
#Load BerTopic model
|
28 |
-
|
|
|
29 |
|
30 |
def is_inappropriate_or_offtopic(message, selected_topics):
|
31 |
# Assume bad_words loading and check_content function are defined here
|
|
|
25 |
topics_list = ['Aviation', 'Science', 'Education', 'Air Force Pilot', 'Space Exploration', 'Technology']
|
26 |
|
27 |
#Load BerTopic model
|
28 |
+
sentence_model = SentenceTransformer("all-MiniLM-L6-v2")
|
29 |
+
topic_model = BERTopic(embedding_model=sentence_model)
|
30 |
|
31 |
def is_inappropriate_or_offtopic(message, selected_topics):
|
32 |
# Assume bad_words loading and check_content function are defined here
|