Spaces:
Running
Running
Commit
·
718db3f
1
Parent(s):
6740a8a
Initial commit for Toxic Detection project
Browse files- app.py +8 -0
- extended_negative_to_positive_words.txt +147 -0
app.py
CHANGED
@@ -149,6 +149,14 @@ def generate_random_antonym(word):
|
|
149 |
# Fungsi untuk memuat mapping negatif ke positif dari file
|
150 |
def load_neg_to_pos_map(filepath):
|
151 |
neg_to_pos_map = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
with open(filepath, "r") as file:
|
153 |
for line_number, line in enumerate(file, start=1):
|
154 |
if line.strip(): # Skip empty lines
|
|
|
149 |
# Fungsi untuk memuat mapping negatif ke positif dari file
|
150 |
def load_neg_to_pos_map(filepath):
|
151 |
neg_to_pos_map = {}
|
152 |
+
# Cek apakah file ada
|
153 |
+
if not os.path.exists(filepath):
|
154 |
+
# Jika file tidak ada, buat file kosong atau dengan data default
|
155 |
+
with open(filepath, "w") as file:
|
156 |
+
file.write("") # Bisa juga menambahkan data default jika perlu
|
157 |
+
print(f"File '{filepath}' tidak ditemukan. File baru telah dibuat.")
|
158 |
+
|
159 |
+
# Baca file jika ada
|
160 |
with open(filepath, "r") as file:
|
161 |
for line_number, line in enumerate(file, start=1):
|
162 |
if line.strip(): # Skip empty lines
|
extended_negative_to_positive_words.txt
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
abandoned : cherished
|
2 |
+
abhorrent : admirable
|
3 |
+
absent : present
|
4 |
+
abusive : caring
|
5 |
+
addicted : free
|
6 |
+
afraid : brave
|
7 |
+
aggressive : peaceful
|
8 |
+
aimless : purposeful
|
9 |
+
alarming : comforting
|
10 |
+
aloof : friendly
|
11 |
+
angry : calm
|
12 |
+
annoying : pleasant
|
13 |
+
anxious : relaxed
|
14 |
+
arrogant : humble
|
15 |
+
ashamed : proud
|
16 |
+
awful : wonderful
|
17 |
+
bad : good
|
18 |
+
barbaric : civilized
|
19 |
+
barren : fertile
|
20 |
+
baseless : grounded
|
21 |
+
bitter : sweet
|
22 |
+
bizarre : normal
|
23 |
+
boring : exciting
|
24 |
+
brutal : gentle
|
25 |
+
callous : compassionate
|
26 |
+
careless : careful
|
27 |
+
chaotic : organized
|
28 |
+
cheap : expensive
|
29 |
+
cheating : honest
|
30 |
+
clumsy : graceful
|
31 |
+
cold : warm
|
32 |
+
combative : agreeable
|
33 |
+
conceited : modest
|
34 |
+
confused : clear
|
35 |
+
controlling : cooperative
|
36 |
+
cowardly : courageous
|
37 |
+
cruel : kind
|
38 |
+
cursed : blessed
|
39 |
+
damaged : repaired
|
40 |
+
dangerous : safe
|
41 |
+
dark : bright
|
42 |
+
dead : alive
|
43 |
+
defeated : victorious
|
44 |
+
defenseless : protected
|
45 |
+
deficient : sufficient
|
46 |
+
depressed : cheerful
|
47 |
+
desolate : lively
|
48 |
+
desperate : hopeful
|
49 |
+
difficult : easy
|
50 |
+
dirty : clean
|
51 |
+
dishonest : honest
|
52 |
+
disloyal : loyal
|
53 |
+
disrespectful : respectful
|
54 |
+
distant : close
|
55 |
+
distressed : calm
|
56 |
+
distrustful : trusting
|
57 |
+
dull : vibrant
|
58 |
+
empty : full
|
59 |
+
envious : content
|
60 |
+
evil : good
|
61 |
+
fearful : fearless
|
62 |
+
foolish : wise
|
63 |
+
forgotten : remembered
|
64 |
+
frail : strong
|
65 |
+
frantic : serene
|
66 |
+
frustrated : satisfied
|
67 |
+
gloomy : joyful
|
68 |
+
greedy : generous
|
69 |
+
grieving : celebrating
|
70 |
+
guilty : innocent
|
71 |
+
harmful : harmless
|
72 |
+
hateful : loving
|
73 |
+
heartless : compassionate
|
74 |
+
helpless : empowered
|
75 |
+
hopeless : hopeful
|
76 |
+
hostile : friendly
|
77 |
+
humiliated : dignified
|
78 |
+
ignorant : knowledgeable
|
79 |
+
impatient : patient
|
80 |
+
impolite : polite
|
81 |
+
inactive : active
|
82 |
+
incompetent : competent
|
83 |
+
inferior : superior
|
84 |
+
insecure : confident
|
85 |
+
insulting : praising
|
86 |
+
jealous : content
|
87 |
+
lazy : industrious
|
88 |
+
lethargic : energetic
|
89 |
+
lonely : connected
|
90 |
+
lost : found
|
91 |
+
malicious : benevolent
|
92 |
+
mean : kind
|
93 |
+
miserable : happy
|
94 |
+
neglected : cared-for
|
95 |
+
negative : positive
|
96 |
+
nervous : relaxed
|
97 |
+
offensive : respectful
|
98 |
+
overwhelmed : composed
|
99 |
+
painful : comfortable
|
100 |
+
pathetic : inspiring
|
101 |
+
poor : wealthy
|
102 |
+
powerless : powerful
|
103 |
+
reckless : cautious
|
104 |
+
rejected : accepted
|
105 |
+
sad : happy
|
106 |
+
selfish : generous
|
107 |
+
shy : confident
|
108 |
+
sick : healthy
|
109 |
+
silent : talkative
|
110 |
+
slow : fast
|
111 |
+
small : big
|
112 |
+
stubborn : flexible
|
113 |
+
stupid : intelligent
|
114 |
+
tense : relaxed
|
115 |
+
terrible : great
|
116 |
+
ugly : beautiful
|
117 |
+
unkind : kind
|
118 |
+
unloved : loved
|
119 |
+
unsuccessful : successful
|
120 |
+
useless : useful
|
121 |
+
weak : strong
|
122 |
+
wicked : righteous
|
123 |
+
worthless : valuable
|
124 |
+
fear : confidence
|
125 |
+
hate : love
|
126 |
+
dishonor : honor
|
127 |
+
failure : success
|
128 |
+
poverty : prosperity
|
129 |
+
conflict : harmony
|
130 |
+
injustice : justice
|
131 |
+
sadness : happiness
|
132 |
+
weakness : strength
|
133 |
+
violence : peace
|
134 |
+
selfishness : selflessness
|
135 |
+
ignorance : wisdom
|
136 |
+
destruction : creation
|
137 |
+
despair : hope
|
138 |
+
inequality : equality
|
139 |
+
oppression : freedom
|
140 |
+
idiot : smart
|
141 |
+
are : differ
|
142 |
+
fuckershit : unknown
|
143 |
+
fucker : unknown
|
144 |
+
dumb : unknown
|
145 |
+
fuckert : unknown
|
146 |
+
fuckerddt : //
|
147 |
+
dumbass : >>>>>>
|