Phi-3 Sustainable Materials Classifier

Fine-tuned Phi-3-mini-4k-instruct model for classifying sustainable materials from product descriptions.

Model Description

This model is a LoRA fine-tuned version of Microsoft's Phi-3-mini-4k-instruct, specifically trained to identify and classify sustainable materials in product descriptions. It can recognize:

  • Renewable Materials: Cork, Bamboo, Wood, Stone Paper, Kraft Paper, Wheat Straw, Bio-Based Plastics, and more
  • Recycled Materials: Recycled PET, RPET Polyester, Recycled Paper/Cardboard, Recycled Cotton, and more
  • Certifications: GRS Certified, RCS Certified, AWARE™, REPREVE

Intended Use

  • Product sustainability analysis
  • E-commerce material classification
  • Environmental compliance checking
  • Sustainable sourcing verification

How to Use

Using Hugging Face Inference API

import requests

API_URL = "https://api-inference.huggingface.co/models/YOUR_USERNAME/phi3-sustainable-materials"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}

def classify_material(product_name):
    prompt = f"""Below is product data. Classify the sustainable material.

### Input:
Product: {product_name}

### Response:
"""
    
    response = requests.post(API_URL, headers=headers, json={
        "inputs": prompt,
        "parameters": {
            "max_new_tokens": 256,
            "temperature": 0.7,
            "return_full_text": False
        }
    })
    return response.json()

# Example
result = classify_material("Recycled Cardboard Notebook")
print(result)

Expected Output Format

{
  "material_name": "Recycled Cardboard",
  "reason": "Product explicitly mentions recycled cardboard material",
  "confidence": "100% confident",
  "confidence_level": "high"
}

Training Data

Trained on a custom dataset of product descriptions with sustainable material annotations, covering:

  • Product names and descriptions
  • Material types and classifications
  • Confidence levels and reasoning

Training Procedure

  • Base Model: microsoft/Phi-3-mini-4k-instruct
  • Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • LoRA Rank: 16
  • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Training Epochs: 3
  • Learning Rate: 2e-4
  • Max Sequence Length: 2048
  • Prompt Format: Alpaca instruction format

Limitations

  • Optimized for English product descriptions
  • Best performance on explicitly mentioned materials
  • May require additional context for generic sustainability claims
  • Confidence levels are model-predicted and should be validated

License

This model is released under the Apache 2.0 License, inheriting from the base Phi-3 model.

Citation

If you use this model, please cite:

@misc{phi3-sustainable-materials,
  author = {Your Name},
  title = {Phi-3 Sustainable Materials Classifier},
  year = {2026},
  publisher = {HuggingFace},
  url = {https://huggingface.co/YOUR_USERNAME/phi3-sustainable-materials}
}

Contact

For questions or feedback, please open an issue on the model repository.

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