Skip to content

MetalCloth/Fine-Tuning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Product Info Extractor β€” Fine-Tuning in One Notebook

This project fine-tunes a language model entirely within a single Jupyter Notebook to extract structured fields β€” name, category, manufacturer, and price β€” from product descriptions.

βœ… All logic β€” dataset prep, model training, and inference β€” is inside product_info_finetune.ipynb.


πŸ’‘ Example Task

Input:

Maggi noodles pack of 2 by NestlΓ© for $0.50

Expected Output:

{
  "name": "Maggi noodles",
  "category": "",
  "manufacturer": "NestlΓ©",
  "price": "$0.50"
}

🧾 What This Notebook Does

βœ” Prepares a noisy, realistic dataset of product descriptions
βœ” Handles missing fields gracefully by returning ""
βœ” Fine-tunes a model (e.g., Mistral, LLaMA, etc.) using TRL or Unsloth
βœ” Runs inference to verify accuracy


🧠 Tech Stack

  • Python 🐍
  • Hugging Face Transformers + Datasets
  • Unsloth (for fast fine-tuning)
  • πŸ€— TRL / SFTTrainer
  • JSONL formatted training data

πŸ§ͺ Example Inference

from transformers import pipeline

pipe = pipeline("text2text-generation", model="your-model-name")

res = pipe("Colgate toothpaste 200g by Colgate-Palmolive for $3")
print(res[0]["generated_text"])

Expected:

{
  "name": "Colgate toothpaste",
  "category": "",
  "manufacturer": "Colgate-Palmolive",
  "price": "$3"
}

πŸ“ File Structure

β”œβ”€β”€ Fine-Tune.ipynb   # πŸ’₯ Everything is in here
β”œβ”€β”€ Data.jsonl            # (optional) saved dataset
β”œβ”€β”€ README.md                     # you're reading this

πŸ“– License

MIT License β€” free to use, modify, and share.


πŸ™‹β€β™‚οΈ Author

Built by Puneet Rawat.
Feel free to fork, star, or open issues for suggestions or improvements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published