Views
No views yet
distilbert-base-uncased from Hugging Face's 🤗 Transformers library. It has been trained for the task of Named Entity Recognition (NER) to process resumes and extract skills, names, and other relevant entities.distilbert-base-uncasedSKILL, NAME, LOCATION, and ORGANIZATION.
The version one model ran for 3 epochs. further model versions will see an improvement in model metrics.DistilBERTTokenizer from Hugging Face.1from transformers import pipeline
2
3# Load the fine-tuned model
4ner_pipeline = pipeline("ner", model="chrisdepallan/ner-skills-distilbert", tokenizer="chrisdepallan/ner-skills-distilbert")
5
6# Example usage
7text= "John Doe Senior Software Engineer – Tech Solutions Inc. New York, NY - Email me on Indeed: indeed.com/r/John-Doe/1234567890abcdef Passionate software engineer with 6+ years of experience in full-stack development, specializing in web applications and cloud technologies. Seeking a challenging role to leverage my expertise in modern frameworks and system design. WORK EXPERIENCE Senior Software Engineer Tech Solutions Inc. – New York, NY – March 2020 to Present - Leading a team of developers to build scalable web applications. - Designed and optimized RESTful APIs using Node.js and Python. - Developed microservices architecture to improve system performance. Software Engineer InnovateX Corp. – New York, NY – June 2017 to February 2020 - Built and maintained enterprise web applications using React.js and Django. - Integrated cloud services (AWS, Azure) for seamless deployment. - Implemented CI/CD pipelines using Jenkins and Docker. EDUCATION M.S. in Computer Science Columbia University – New York, NY B.S. in Computer Science University of California, Berkeley – Berkeley, CA SKILLS Python (6 years), Java (5 years), JavaScript (6 years), React.js (4 years), AWS (3 years) ADDITIONAL INFORMATION Technical skills: Languages: Python, Java, JavaScript, TypeScript, C++ Web Development: React.js, Angular, Node.js, Django, Flask Databases: PostgreSQL, MySQL, MongoDB Cloud Technologies: AWS (EC2, S3, Lambda), Azure, GCP DevOps: Docker, Kubernetes, Terraform, Jenkins Version Control: Git, GitHub, Bitbucket Testing Frameworks: Selenium, PyTest, Jest https://www.indeed.com/r/John-Doe/1234567890abcdef?isid=rex-download&ikw=download-top&co=US https://www.indeed.com/r/John-Doe/1234567890abcdef?isid=rex-download&ikw=download-top&co=US Certifications: AWS Certified Solutions Architect – Associate Google Cloud Professional Developer Project Details: 'E-Commerce Platform Development' (Client: RetailX Inc.) Front-End: React.js, Redux Back-End: Node.js, Express.js Database: PostgreSQL Duration: 8 months Description: Designed and developed a fully functional e-commerce website with user authentication, payment gateway integration, and order tracking. 'AI-Powered Chatbot for Customer Support' (Company Project – Tech Solutions Inc.) Tools: Python, TensorFlow, Rasa NLP Duration: 6 months Description: Developed an AI-driven chatbot to enhance customer support, reducing response time by 40%. 'Inventory Management System' (B.S. Final Year Project) Language: Java Database: MySQL Operating System: Windows 10 The Inventory Management System is designed to automate stock management and reduce errors in manual tracking."
8
9entities = ner_pipeline(text)
10print(entities)predict_entities function to predict named entities from a given text. Below is an example of how to use it:1import torch
2
3# Define the function
4def predict_entities(text):
5 """Predict named entities from the input text"""
6 inputs = tokenizer(
7 text,
8 return_tensors="pt", # PyTorch tensors
9 truncation=True, # Truncate if longer than max length
10 padding="max_length", # Pad sequences
11 max_length=512 # Max sequence length
12 )
13
14 # Get model predictions
15 with torch.no_grad():
16 outputs = model(**inputs)
17
18 # Get predicted class indices
19 logits = outputs.logits
20 predictions = torch.argmax(logits, dim=2).numpy()[0]
21
22 # Convert token IDs to actual words
23 tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
24
25 # Convert prediction indices to label names
26 predicted_labels = [id2tag[idx] for idx in predictions]
27
28 # Print results
29 result = list(zip(tokens, predicted_labels))
30 for token, label in result:
31 print(f"Token: {token} | Predicted Label: {label}")
32
33 return resultpredict_entities function can also be used to extract specific entities, such as skills, from a given text. Below is an example of how to use it to extract skills:1import torch
2
3# Define the function
4def predict_entities(text):
5 """Predict named entities from the input text and extract skills."""
6 inputs = tokenizer(
7 text,
8 return_tensors="pt", # PyTorch tensors
9 truncation=True,
10 padding="max_length",
11 max_length=512
12 )
13
14 with torch.no_grad():
15 outputs = model(**inputs)
16
17 logits = outputs.logits
18 predictions = torch.argmax(logits, dim=2).numpy()[0]
19
20 tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
21 predicted_labels = [id2tag[idx] for idx in predictions]
22
23 # Extract only tokens labeled as "Skills"
24 skills = [token for token, label in zip(tokens, predicted_labels) if label == "Skills"]
25
26 print("Extracted Skills:", " ".join(skills))
27 return skills
28
29# Example Usage
30skills = predict_entities(text)
31print("Skills:", skills)