Downloads · 30 days
19
5% of all-time downloads
shujatoor/phi3nedtuned-ner
phi3nedtuned-ner is a machine learning model from shujatoor. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
19
5% of all-time downloads
All-time downloads
412
Public
Repo size
51 MB
Likes
1
Public
Click a slice to open those files.
.safetensors50.4 MB · 95%
From the Hugging Face model README
This model is a fine-tuned version of microsoft/Phi-3-mini-4k-instruct on the generator dataset. It achieves the following results on the evaluation set:
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
config = PeftConfig.from_pretrained("shujatoor/phi3nedtuned-ner")
model = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3-mini-4k-instruct",
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, "shujatoor/phi3nedtuned-ner")
model.config.to_json_file('adapter_config.json')
torch.random.manual_seed(0)
tokenizer = AutoTokenizer.from_pretrained("shujatoor/phi3nedtuned-ner")
text = "Hasan Pharmacy Madina Market Mustafa Chowk.PCsiR Staff Society College Road, Lahore Drug Lic#441-A/AIT No.1023874 24/04/202422:18:03 M/s*CASH SALES-WALKING CUST Remarks: Ref.: Item Name Qty Price Total Advant Tab 16mg 28 37.50 1050.00 Kepra 500mg Tab 30 85.91 2577.30 Kabrokin 200mg 240 10.67 2560.80 Tab Myteka 10mg Tab 14 37.71 527.94 Cipocain Ear/drops 1 168.00 168.00 Medicam T/paste 1 240.00 240.00 100gm Total items:6 Gross Total : 7,124.04 Disc: 523.68 DR.HASAN Net Total. 6,600.00 (Computer Software developed by Abuzar Consultancy Ph 042-37426911-15)."
qs = f'{text} What is the drug license number of the store??'
print('Question:',qs, '\n')
messages = [
#{"role": "system", "content": "Only output the answer, nothing else"},
{"role": "user", "content": qs},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 512,
"return_full_text": False,
#"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print('Answer:', output[0]['generated_text'], '\n')
"""
expected answer:
Answer: 441-A/AIT No.1023874
"""
Named Entity Recognition (NER)
More information needed
The following hyperparameters were used during training:
The model is licensed under the MIT license.