CoolFace
Modelpublic

chrisdepallan/ner-skills-distilbert

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes6downloads
Model Card

Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->

Model Details

Model Description

This model is a fine-tuned version of 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.

  • โ€”Developed by: Chris Dennis Pallan
  • โ€”Funded by: Dr.Bijimol TK,AJCE
  • โ€”Shared by: Chris Dennis Pallan
  • โ€”Model type: Transformer-based model (DistilBERT)
  • โ€”Language(s) (NLP): English,Malayalam
  • โ€”License: Apache 2.0
  • โ€”Finetuned from model: distilbert-base-uncased

Model Sources

Uses

Direct Use

This model can be used directly for Named Entity Recognition tasks, such as identifying skills, names, and other entities in resumes or similar documents.

Downstream Use

The model can be fine-tuned further for domain-specific NER tasks, such as extracting medical or legal entities.

Out-of-Scope Use

The model is not suitable for tasks outside of text-based entity recognition or for languages other than English.

Training Details

Training Data

The model was fine-tuned on a dataset designed for resume parsing and skill extraction. The dataset includes labeled examples for entities such as SKILL, NAME, LOCATION, and ORGANIZATION. The version one model ran for 3 epochs. further model versions will see an improvement in model metrics.

Training Procedure

Preprocessing
  • โ€”Tokenization was performed using the DistilBERTTokenizer from Hugging Face.
  • โ€”The dataset was cleaned and preprocessed to align entity spans and convert data into a format compatible with Hugging Face's token classification pipeline.
Training Hyperparameters
  • โ€”Batch size: 16
  • โ€”Learning rate: 5e-5
  • โ€”Epochs: 3
  • โ€”Optimizer: AdamW
  • โ€”Mixed Precision Training: Enabled (fp16)

Evaluation

Testing Data, Factors & Metrics

Testing Data

The model was evaluated on a test split of the resume dataset. <!--

Metrics
  • โ€”F1 Score: [Add value from notebook]
  • โ€”Precision: [Add value from notebook]
  • โ€”Recall: [Add value from notebook] -->

Results

The model achieved an F1 score of [Add value] on the test set, demonstrating strong performance for Named Entity Recognition tasks.

Environmental Impact

  • โ€”Hardware Type: NVIDIA Tesla V100 GPU
  • โ€”Hours used: Approximately [Add value from notebook] hours
  • โ€”Cloud Provider: AWS
  • โ€”Compute Region: US East (N. Virginia)
  • โ€”Carbon Emitted: Estimated using the Machine Learning Impact calculator.

How to Get Started with the Model

python
from transformers import pipeline

# Load the fine-tuned model
ner_pipeline = pipeline("ner", model="chrisdepallan/ner-skills-distilbert", tokenizer="chrisdepallan/ner-skills-distilbert")

# Example usage
text= "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."

entities = ner_pipeline(text)
print(entities)

Example Usage: Predicting Named Entities

You can use the predict_entities function to predict named entities from a given text. Below is an example of how to use it:

python
import torch

# Define the function
def predict_entities(text):
    """Predict named entities from the input text"""
    inputs = tokenizer(
        text,
        return_tensors="pt",        # PyTorch tensors
        truncation=True,            # Truncate if longer than max length
        padding="max_length",       # Pad sequences
        max_length=512              # Max sequence length
    )

    # Get model predictions
    with torch.no_grad():
        outputs = model(**inputs)

    # Get predicted class indices
    logits = outputs.logits
    predictions = torch.argmax(logits, dim=2).numpy()[0]

    # Convert token IDs to actual words
    tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])

    # Convert prediction indices to label names
    predicted_labels = [id2tag[idx] for idx in predictions]

    # Print results
    result = list(zip(tokens, predicted_labels))
    for token, label in result:
        print(f"Token: {token} | Predicted Label: {label}")

    return result

Example Usage: Extracting Skills from a Resume

The predict_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:

python
import torch

# Define the function
def predict_entities(text):
    """Predict named entities from the input text and extract skills."""
    inputs = tokenizer(
        text,
        return_tensors="pt",  # PyTorch tensors
        truncation=True,
        padding="max_length",
        max_length=512
    )

    with torch.no_grad():
        outputs = model(**inputs)

    logits = outputs.logits
    predictions = torch.argmax(logits, dim=2).numpy()[0]

    tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
    predicted_labels = [id2tag[idx] for idx in predictions]

    # Extract only tokens labeled as "Skills"
    skills = [token for token, label in zip(tokens, predicted_labels) if label == "Skills"]

    print("Extracted Skills:", " ".join(skills))
    return skills

# Example Usage
skills = predict_entities(text)
print("Skills:", skills)

Model Sources [optional]

<!-- Provide the basic links for the model. -->

  • โ€”Repository: [More Information Needed]
  • โ€”Paper [optional]: [More Information Needed]
  • โ€”Demo [optional]: [More Information Needed]

Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

Direct Use

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->

[More Information Needed]

Downstream Use [optional]

<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->

[More Information Needed]

Out-of-Scope Use

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

[More Information Needed]

Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

[More Information Needed]

Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

How to Get Started with the Model

Use the code below to get started with the model.

[More Information Needed]

Training Details

Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

[More Information Needed]

Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters
  • โ€”Training regime: [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
Speeds, Sizes, Times [optional]

<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->

[More Information Needed]

Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

Testing Data, Factors & Metrics

Testing Data

<!-- This should link to a Dataset Card if possible. -->

[More Information Needed]

Factors

<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->

[More Information Needed]

Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

[More Information Needed]

Results

[More Information Needed]

Summary

Model Examination [optional]

<!-- Relevant interpretability work for the model goes here -->

[More Information Needed]

Environmental Impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • โ€”Hardware Type: [More Information Needed]
  • โ€”Hours used: [More Information Needed]
  • โ€”Cloud Provider: [More Information Needed]
  • โ€”Compute Region: [More Information Needed]
  • โ€”Carbon Emitted: [More Information Needed]

Technical Specifications [optional]

Model Architecture and Objective

[More Information Needed]

Compute Infrastructure

[More Information Needed]

Hardware

[More Information Needed]

Software

[More Information Needed]

Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

BibTeX:

[More Information Needed]

APA:

[More Information Needed]

Glossary [optional]

<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->

[More Information Needed]

More Information [optional]

[More Information Needed]

Model Card Authors [optional]

[More Information Needed]

Model Card Contact

[More Information Needed]