Anushkabhat9 commited on
Commit
8c431c8
·
verified ·
1 Parent(s): de16466

Upload similarity_score_refined.py

Browse files
Files changed (1) hide show
  1. similarity_score_refined.py +7 -7
similarity_score_refined.py CHANGED
@@ -16,14 +16,14 @@ Original file is located at
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,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 = userdata.get('OPEN_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=[