Skip to content

Commit f6d624e

Browse files
committed
update
1 parent 0fab6af commit f6d624e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nlp_class3/cnn_toxic.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@
5656
possible_labels = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
5757
targets = train[possible_labels].values
5858

59-
print("max sequence length:", max(len(s) for s in sentences))
60-
print("min sequence length:", min(len(s) for s in sentences))
61-
s = sorted(len(s) for s in sentences)
62-
print("median sequence length:", s[len(s) // 2])
63-
64-
6559

6660

6761
# convert the sentences (strings) into integers
@@ -71,6 +65,12 @@
7165
# print("sequences:", sequences); exit()
7266

7367

68+
print("max sequence length:", max(len(s) for s in sequences))
69+
print("min sequence length:", min(len(s) for s in sequences))
70+
s = sorted(len(s) for s in sequences)
71+
print("median sequence length:", s[len(s) // 2])
72+
73+
7474
# get word -> integer mapping
7575
word2idx = tokenizer.word_index
7676
print('Found %s unique tokens.' % len(word2idx))

0 commit comments

Comments
 (0)