Spaces:
Sleeping
Sleeping
Anushkabhat9
commited on
Upload similarity_score_refined.py
Browse files
similarity_score_refined.py
CHANGED
@@ -16,14 +16,14 @@ Original file is located at
|
|
16 |
# print("Google Drive mounted.")
|
17 |
|
18 |
import re
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
# Ensure you have downloaded stopwords and wordnet
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
def extract_text(file_path):
|
29 |
import docx2txt
|
@@ -77,7 +77,7 @@ def calculate_tfidf(doc):
|
|
77 |
|
78 |
def call_chatgpt_api(prompt, api_key,model="gpt-3.5-turbo"):
|
79 |
import openai
|
80 |
-
openai.api_key =
|
81 |
response = openai.ChatCompletion.create(
|
82 |
model="gpt-3.5-turbo",
|
83 |
messages=[
|
|
|
16 |
# print("Google Drive mounted.")
|
17 |
|
18 |
import re
|
19 |
+
from sklearn.feature_extraction.text import TfidfVectorizer
|
20 |
+
from nltk.corpus import stopwords
|
21 |
+
from nltk.stem import WordNetLemmatizer
|
22 |
|
23 |
# Ensure you have downloaded stopwords and wordnet
|
24 |
+
import nltk
|
25 |
+
nltk.download('stopwords')
|
26 |
+
nltk.download('wordnet')
|
27 |
|
28 |
def extract_text(file_path):
|
29 |
import docx2txt
|
|
|
77 |
|
78 |
def call_chatgpt_api(prompt, api_key,model="gpt-3.5-turbo"):
|
79 |
import openai
|
80 |
+
openai.api_key = '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'
|
81 |
response = openai.ChatCompletion.create(
|
82 |
model="gpt-3.5-turbo",
|
83 |
messages=[
|