Views
No views yet
roberta-base)NAMECONTACT, EMAIL, LOCATIONLINKEDIN, GITHUBORG_NAME, JOB_TITLE, START_DATE, END_DATEDEGREE, FIELD_OF_STUDY, GRADUATION_YEAR, GPASKILLS, PROJECT_TITLE, LANGUAGES, OTHERconfig.jsonpytorch_model.bin or model.safetensorstokenizer_config.json, vocab.json, tokenizer.jsonspecial_tokens_map.jsonmerges.txt1from transformers import RobertaTokenizerFast, RobertaForTokenClassification
2import torch
3
4# Load model and tokenizer
5model = RobertaForTokenClassification.from_pretrained("venkatasagar/NER-roBERTa-finetuned")
6tokenizer = RobertaTokenizerFast.from_pretrained("venkatasagar/NER-roBERTa-finetuned")
7
8# Sample text
9text = "John Doe is a software engineer at Google. He graduated with a B.Tech in Computer Science from MIT in 2022."
10
11# Tokenize and predict
12inputs = tokenizer(text, return_tensors="pt")
13outputs = model(**inputs)
14predictions = torch.argmax(outputs.logits, dim=-1)
15
16# Decode results
17tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
18predicted_labels = [model.config.id2label[label_id] for label_id in predictions[0]]
19
20for token, label in zip(tokens, predicted_labels):
21 print(f"{token}: {label}")NER, transformers, huggingface, token-classification, roberta, resume-parser, nlp, named-entity-recognition, custom-dataset, career-data, information-extraction.txt, .pdf, and .docx formats processed using SpaCy and PyMuPDF/Docx libraries.