Spaces:
Sleeping
Sleeping
Commit
·
ccb6a47
1
Parent(s):
50a2256
using original function to get scores
Browse files- helper.py +16 -16
- parse_job_description.py +2 -2
helper.py
CHANGED
|
@@ -184,27 +184,27 @@ import time
|
|
| 184 |
# These are the functions called by scoring(): extract_skills, match_personality_traits,
|
| 185 |
# extract_experience, and extract_education
|
| 186 |
|
| 187 |
-
def get_scores_optimized(df, job_description):
|
| 188 |
-
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
-
|
| 204 |
-
|
| 205 |
|
| 206 |
-
|
| 207 |
-
|
| 208 |
|
| 209 |
|
| 210 |
# current_time=datetime.now()
|
|
|
|
| 184 |
# These are the functions called by scoring(): extract_skills, match_personality_traits,
|
| 185 |
# extract_experience, and extract_education
|
| 186 |
|
| 187 |
+
# def get_scores_optimized(df, job_description):
|
| 188 |
+
# print('inside scores optimized..............')
|
| 189 |
+
# start_time = time.time()
|
| 190 |
|
| 191 |
+
# # Method 1: Use chunking with the original apply method
|
| 192 |
+
# chunk_size = 32
|
| 193 |
+
# results = []
|
| 194 |
|
| 195 |
+
# for i in range(0, len(df), chunk_size):
|
| 196 |
+
# chunk = df.iloc[i:i+chunk_size]
|
| 197 |
+
# chunk_results = chunk['Resume'].apply(lambda x: scoring(x, job_description))
|
| 198 |
+
# results.extend(chunk_results.tolist())
|
| 199 |
|
| 200 |
+
# # Convert the list of dictionaries into a DataFrame and join with original
|
| 201 |
+
# scores_df = pd.DataFrame(results, index=df.index)
|
| 202 |
|
| 203 |
+
# end_time = time.time()
|
| 204 |
+
# print(f"Processing took {end_time - start_time:.2f} seconds")
|
| 205 |
|
| 206 |
+
# # Return the original dataframe with the new columns
|
| 207 |
+
# return pd.concat([df, scores_df], axis=1)
|
| 208 |
|
| 209 |
|
| 210 |
# current_time=datetime.now()
|
parse_job_description.py
CHANGED
|
@@ -7,8 +7,8 @@ import json
|
|
| 7 |
|
| 8 |
load_dotenv()
|
| 9 |
|
| 10 |
-
## For hugging face
|
| 11 |
-
os.environ['OPENAI_API_KEY']=os.getenv('OPENAI_API_KEY')
|
| 12 |
|
| 13 |
## for local run
|
| 14 |
os.environ['OPENAI_API_KEY']=os.getenv('OPENAI_API_KEY')
|
|
|
|
| 7 |
|
| 8 |
load_dotenv()
|
| 9 |
|
| 10 |
+
# ## For hugging face
|
| 11 |
+
# os.environ['OPENAI_API_KEY']=os.getenv('OPENAI_API_KEY')
|
| 12 |
|
| 13 |
## for local run
|
| 14 |
os.environ['OPENAI_API_KEY']=os.getenv('OPENAI_API_KEY')
|