datasync
swadhinbiswas committed 2 years ago
6e1b220
1 parent 8e31262
commit 6e1b220
1 file changed
+7 -1
Showing 1 changed file+7-1
▼services/findPlager.py
+7-1
| @@ -4,11 +4,17 @@ from nltk.corpus import stopwords | ||
4 | 4 | from nltk.stem import WordNetLemmatizer |
5 | 5 | from collections import Counter |
6 | 6 | |
7 | +nltk.download('punkt') | |
8 | +nltk.download('stopwords') | |
9 | +nltk.download('wordnet') | |
10 | + | |
11 | +# Define a class to find plagiarism | |
12 | + | |
7 | 13 | class FindPlager(): |
8 | 14 | def __init__(self,text1,text2): |
9 | 15 | self.text1 = text1 |
10 | 16 | self.text2 = text2 |
11 | - @staticmethod | |
17 | + | |
12 | 18 | def preprocess(self,text): |
13 | 19 | # Tokenize the text |
14 | 20 | tokens = word_tokenize(text.lower()) |
15 | 21 | |