Update app.py
Browse files
app.py
CHANGED
@@ -1323,50 +1323,6 @@ df = pd.DataFrame(results)
|
|
1323 |
summary = df.groupby("k")[["precision", "recall", "f1"]].mean().round(3)
|
1324 |
print(summary)
|
1325 |
|
1326 |
-
import pandas as pd
|
1327 |
-
import matplotlib.pyplot as plt
|
1328 |
-
import seaborn as sns
|
1329 |
-
|
1330 |
-
# Load the dataset
|
1331 |
-
df = pd.read_csv("/Users/husseinelsaadi/kaggle-local-project/data/retrieval_metrics_table.csv")
|
1332 |
-
|
1333 |
-
# Set plot style
|
1334 |
-
sns.set(style="whitegrid")
|
1335 |
-
|
1336 |
-
# Plot 1: Precision per Job Role
|
1337 |
-
plt.figure(figsize=(12, 6))
|
1338 |
-
sns.barplot(data=df, x="job_role", y="precision")
|
1339 |
-
plt.title("Precision@K per Job Role")
|
1340 |
-
plt.xticks(rotation=45, ha="right")
|
1341 |
-
plt.tight_layout()
|
1342 |
-
plt.show()
|
1343 |
-
|
1344 |
-
# Plot 2: Recall per Job Role
|
1345 |
-
plt.figure(figsize=(12, 6))
|
1346 |
-
sns.barplot(data=df, x="job_role", y="recall")
|
1347 |
-
plt.title("Recall@K per Job Role")
|
1348 |
-
plt.xticks(rotation=45, ha="right")
|
1349 |
-
plt.tight_layout()
|
1350 |
-
plt.show()
|
1351 |
-
|
1352 |
-
# Plot 3: F1 Score per Job Role
|
1353 |
-
plt.figure(figsize=(12, 6))
|
1354 |
-
sns.barplot(data=df, x="job_role", y="f1")
|
1355 |
-
plt.title("F1@K per Job Role")
|
1356 |
-
plt.xticks(rotation=45, ha="right")
|
1357 |
-
plt.tight_layout()
|
1358 |
-
plt.show()
|
1359 |
-
|
1360 |
-
# Plot 4: Grouped Bar Chart for Precision, Recall, F1
|
1361 |
-
df_melted = df.melt(id_vars="job_role", value_vars=["precision", "recall", "f1"],
|
1362 |
-
var_name="Metric", value_name="Score")
|
1363 |
-
plt.figure(figsize=(14, 6))
|
1364 |
-
sns.barplot(data=df_melted, x="job_role", y="Score", hue="Metric")
|
1365 |
-
plt.title("Retrieval Evaluation Metrics per Job Role")
|
1366 |
-
plt.xticks(rotation=45, ha="right")
|
1367 |
-
plt.legend(title="Metric")
|
1368 |
-
plt.tight_layout()
|
1369 |
-
plt.show()
|
1370 |
|
1371 |
def extract_job_details(job_description):
|
1372 |
"""Extract job details such as title, skills, experience level, and years of experience from the job description."""
|
|
|
1323 |
summary = df.groupby("k")[["precision", "recall", "f1"]].mean().round(3)
|
1324 |
print(summary)
|
1325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1326 |
|
1327 |
def extract_job_details(job_description):
|
1328 |
"""Extract job details such as title, skills, experience level, and years of experience from the job description."""
|