Anupam251272 commited on
Commit
a356dab
Β·
verified Β·
1 Parent(s): 9f9f228

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -57
app.py CHANGED
@@ -1,17 +1,13 @@
1
  import spacy
2
  from spacy.cli import download
3
  import nltk
 
4
  import gradio as gr
5
  import torch
6
- import re
7
- import PyPDF2
8
- import numpy as np
9
- import pandas as pd
10
- from transformers import pipeline
11
  from sentence_transformers import SentenceTransformer
12
- from sklearn.metrics.pairwise import cosine_similarity
13
 
14
- # Download necessary NLTK resources
15
  try:
16
  nltk.data.find('tokenizers/punkt')
17
  except LookupError:
@@ -33,56 +29,6 @@ embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
33
  device = "cuda" if torch.cuda.is_available() else "cpu"
34
  print(f"Running on: {device}")
35
 
36
- # Enhanced Career Database with a specific "Engineering" Domain
37
- CAREER_DATABASE = {
38
- "Technology": {
39
- "skills": ["Python", "Java", "Machine Learning", "Data Science", "Cloud Computing", "Cybersecurity", "Web Development", "Software Development", "Database Management"],
40
- "careers": [
41
- {"title": "Software Engineer", "description": "Develops software applications and systems"},
42
- {"title": "Data Scientist", "description": "Analyzes complex data to help make business decisions"},
43
- {"title": "Cloud Solutions Architect", "description": "Designs and manages cloud computing strategies"},
44
- {"title": "AI/ML Engineer", "description": "Creates intelligent systems and machine learning models"},
45
- {"title": "Database Administrator", "description": "Manages databases, ensures data security"}
46
- ]
47
- },
48
- "Engineering": {
49
- "skills": ["CAD", "CAM", "Matlab", "Mechanical Design", "Manufacturing Engineering", "Quality Control", "Thermal Engineering", "Fluid Mechanics", "GD&T", "Engineering Drawings", "Blueprint reading", "Product Design", "FEA Analysis"],
50
- "careers": [
51
- {"title": "Mechanical Engineer", "description": "Designs, develops, and tests mechanical devices and systems"},
52
- {"title": "Manufacturing Engineer", "description": "Optimizes manufacturing processes for efficiency and quality"},
53
- {"title": "Quality Engineer", "description": "Oversees quality assurance activities and ensures products meet standards."},
54
- {"title": "Design Engineer", "description": "Creates product designs and technical drawings using CAD software"}
55
- ]
56
- },
57
- "Business": {
58
- "skills": ["Project Management", "Marketing", "Business Analysis", "Sales", "Finance", "Consulting", "Market Research"],
59
- "careers": [
60
- {"title": "Business Analyst", "description": "Identifies business needs and determines solutions"},
61
- {"title": "Marketing Manager", "description": "Develops and implements marketing strategies"},
62
- {"title": "Project Manager", "description": "Leads and coordinates project teams and resources"},
63
- {"title": "Management Consultant", "description": "Advises organizations on improving performance"}
64
- ]
65
- },
66
- "Creative": {
67
- "skills": ["Graphic Design", "Content Writing", "Digital Marketing", "UI/UX Design", "Video Production", "SEO", "Social Media Marketing"],
68
- "careers": [
69
- {"title": "Graphic Designer", "description": "Creates visual concepts using computer software or by hand"},
70
- {"title": "Content Strategist", "description": "Develops content plans and marketing strategies"},
71
- {"title": "UI/UX Designer", "description": "Designs user interfaces for digital products"},
72
- {"title": "Digital Marketing Specialist", "description": "Promotes brands and products through digital channels"}
73
- ]
74
- },
75
- "Healthcare": {
76
- "skills": ["Patient Care", "Medical Research", "Healthcare Administration", "Medical Technology", "Anatomy", "Physiology", "Pharmacology"],
77
- "careers": [
78
- {"title": "Healthcare Administrator", "description": "Manages healthcare facilities and services"},
79
- {"title": "Medical Researcher", "description": "Conducts research to improve medical knowledge"},
80
- {"title": "Healthcare Consultant", "description": "Advises healthcare organizations on improvement strategies"},
81
- {"title": "Medical Assistant", "description": "Assists with patient care and medical administrative tasks."}
82
- ]
83
- }
84
- }
85
-
86
  # Function to extract text from PDF
87
  def extract_text_from_pdf(file_path):
88
  try:
 
1
  import spacy
2
  from spacy.cli import download
3
  import nltk
4
+ import os
5
  import gradio as gr
6
  import torch
 
 
 
 
 
7
  from sentence_transformers import SentenceTransformer
8
+ import PyPDF2
9
 
10
+ # Ensure NLTK 'punkt' tokenizer is downloaded
11
  try:
12
  nltk.data.find('tokenizers/punkt')
13
  except LookupError:
 
29
  device = "cuda" if torch.cuda.is_available() else "cpu"
30
  print(f"Running on: {device}")
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  # Function to extract text from PDF
33
  def extract_text_from_pdf(file_path):
34
  try: