YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Model Card for shresthagarwal/Phi_3_5_Instruct_Unsloth_line_item

Model Overview

This model, shresthagarwal/Phi_3_5_Instruct_Unsloth_line_item, is a fine-tuned version of the Phi 3.5 Instruct model, specifically designed for extracting and mapping structured data from JSON inputs. It is particularly useful for tasks involving the extraction of financial and billing information from invoices and receipts.

Model Details

Model Description

  • Developed by: Shrestha Garwal
  • Funded by: [Optional: Funding Source]
  • Shared by: [Optional: Sharing Source]
  • Model type: Transformer-based language model
  • Language(s) (NLP): English
  • License: [Optional: License Type]
  • Finetuned from model: Phi 3.5 Instruct

Model Sources

  • Repository: [Link to Repository]
  • Paper [optional]: [Link to Paper]
  • Demo [optional]: [Link to Demo]

Use Cases

Direct Use

  • Extracting structured data from JSON inputs: The model can be used to extract and map specific fields from JSON inputs to predefined classes.
  • Financial and billing information extraction: It is particularly useful for extracting HSN codes, descriptions, quantities, unit prices, and other financial details from invoices and receipts.

Downstream Use [optional]

  • Integration with financial systems: The model can be integrated into financial systems to automate data extraction and processing.
  • Data validation and cleaning: It can be used to validate and clean extracted data before further processing.

Out-of-Scope Use

  • Non-structured data extraction: The model is not designed for extracting data from non-structured text or images.
  • Real-time processing: While the model can be used in real-time applications, it may not be optimized for extremely high-throughput scenarios.

Bias, Risks, and Limitations

Bias

  • Data bias: The model's performance may be biased if the training data is not representative of the real-world data it will encounter.
  • Domain bias: The model may perform poorly on data from domains not represented in the training data.

Risks

  • Misclassification: There is a risk of misclassifying data, especially if the input JSON is complex or contains ambiguous information.
  • Security: Ensure that the model is used in a secure environment to protect sensitive financial data.

Limitations

  • Generalization: The model may not generalize well to data that differs significantly from the training data.
  • Performance: The model's performance may degrade with very large or complex JSON inputs.

Recommendations

  • Data validation: Always validate the output of the model to ensure accuracy.
  • Regular updates: Regularly update the model with new data to improve its performance and reduce bias.

How to Get Started with the Model

Installation

First, install the required dependencies:

pip install transformers unsloth

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained( model_name="shresthagarwal/Phi_3_5_Instruct_Unsloth_line_item", # YOUR MODEL YOU USED FOR TRAINING max_seq_length=max_seq_length, dtype=dtype, load_in_4bit=load_in_4bit, ) FastLanguageModel.for_inference(model) # Enable native 2x faster inference

messages = [

{"from": "human", "value": "What is a famous tall tower in Paris?"},

]

messages = [ {"from": "human", "value": "From the input JSON, your task is to map the values of the input JSON to our predefined classes based on context and output that as a JSON. The predefined classes are HsnCode, Description, Quantity, UnitOfMeasurement, UnitPrice, TotalItemAmount, CgstRate, CgstAmount, SgstRate, SgstAmount, IgstRate, IgstAmount, TaxableValue, CessRate, CessAmount. If the key or value of the input JSON contain more than two data fields like HSN code and Description, you have to map both of their outputs into their respective classes for eg, 123456 Book1 to be, HsnCode: 123456, Description: Book1. If the value does not map to any of our predefined classes, leave that class blank. Provide only the JSON as output and no additional text. In the end only output relevant table items from the rest. Input Data: [{"Bill From:": "GSTIN: 06ADDPT0274H003", "Bill To:": "GSTIN: 24AAZFM1250H1Z5", "Ship To:": "GSTIN: 24AAZFM1250H1Z5"}, {"Bill From:": "Name: BDO India LLP", "Bill To:": "Name: Tata", "Ship To:": "Name: Tata"}, {"Bill From:": "Address: The Palm Springs Plaza, Office No. 1501-10,, ,Sector-54, Golf Course Road,", "Bill To:": "Address: Lad Society Road, Vastrapur , City: Ahmedabad Pin Code: 380015", "Ship To:": "Address: Lad Society Road, Vastrapur, City: Gujarat"}, {"Bill From:": "City: Gurgaon Pin Code: 122001", "Ship To:": "Pin Code: 380015"}]"}, ]

inputs = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, # Must add for generation return_tensors="pt", ).to("cuda")

from transformers import TextStreamer text_streamer = TextStreamer(tokenizer, skip_prompt=True) _ = model.generate(input_ids=inputs, streamer=text_streamer, max_new_tokens=4096, use_cache=True)

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support