--- library_name: transformers model_name: phinance-multi-uz-4 tags: - generated_from_trainer - trl - sft licence: license datasets: - Josephgflowers/Finance-Instruct-500k - behbudiy/alpaca-cleaned-uz - yakhyo/uz-news - yakhyo/uz-wiki - Josephgflowers/Finance_Curriculum_Edu_English - Josephgflowers/Finance-Curriculum-Edu-Uzbek language: - en - uz - ar base_model: - microsoft/Phi-4-mini-instruct --- # Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1: Uzbek Finance Instruction LLM --- \ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6328952f798f8d122ce62a44/lJeWZvS5EeOVN9ok5qQhZ.png) ## 🚀 Model Highlights * **Major upgrade over [phi-4-mini-instruct](https://huggingface.co/microsoft/phi-4-mini-instruct):** Achieves *dramatically better* reasoning, accuracy, and Uzbek language ability—especially for financial Q\&A, reasoning, entity extraction, tabular math, and functional NLP tasks. * **Instruction-tuned for finance in multiple languages with a focus on Uzbek and English** Excels at Q\&A, reasoning, table and JSON parsing, translation, summarization, and more. * **Robust out-of-the-box performance:** Tested examples below use a general finance expert system prompt, but *many tasks will perform even better with specialized system prompts* (e.g., NER, parsing, etc.). --- ## 🏦 Example Capabilities > *All outputs below were generated with a general system prompt. For even higher accuracy on structured/NLP tasks, use a specialized system message for the target task.* ### Q\&A (Uzbek) **Savol:** Diversifikatsiya nima va u sarmoyador uchun nima uchun muhim? **Javob:** Diversifikatsiya – bu sarmoyadorning investitsiya portfelini bir nechta turli aktivlarga tarqatish amaliyotidir. Bu sarmoyadorning xavfini kamaytirish va daromadlarini oshirish uchun investitsiyalarni turli xil investitsiya vositalariga tarqatishni o‘z ichiga oladi. --- ### Tabular Math & Reasoning **Prompt:** Siz bankdan 10 million so‘m miqdorida kredit olmoqchisiz. Kredit muddati 2 yil, yillik foiz stavkasi 18%. Siz har oy bir xil miqdorda to‘lov qilasiz. Har oylik to‘lov miqdorini qanday hisoblash mumkin? **Model:** Avvalo, kreditning umumiy summasi va foiz stavkasini aniqlang... A = 10 000 000 × 0.015 × (1 + 0.015)^24 / ((1 + 0.015)^24 - 1) Natijada, har oy to‘lov miqdori taxminan 470 000 so‘m bo‘ladi. --- ### Functional Tasks (Entity Extraction, JSON, Summarization, Data Cleaning) **Prompt:** Quyidagi matndan barcha nomlangan entitetlarni ajratib, har birini tasniflang: \[Kompaniya, Moliyaviy mahsulot, Qonun, Shaxs, Joy, Sana, Miqdor]\nMatn: 10-iyul kuni O‘zbekiston Banki yangi “Yashil ipoteka” dasturini ishga tushirdi, bu Markaziy bankning 2024-03-sonli Qoidalariga muvofiq. **Model:** 1. Kompaniya: O‘zbekiston Banki 2. Moliyaviy mahsulot: Yashil ipoteka dasturi 3. Qonun: Markaziy bankning 2024-03-sonli Qoidalari 4. Sana: 10-iyul --- **Prompt:** Quyidagi moliyaviy hisobot xulosasini quyidagi maydonlarga ega JSON formatiga o‘tkazing: "kompaniya", "chorak", "daromad", "xarajatlar", "sof foyda". **Matn:** 2024-yil 2-chorakda “Silk Road Telecom” jami daromadi 32 mln dollar, xarajatlari 27 mln dollar va sof foydasi 5 mln dollar bo‘ldi. **Model:** ```json { "kompaniya": "Silk Road Telecom", "chorak": "2024-yil 2-chorak", "daromad": 32000000, "xarajatlar": 27000000, "sof foyda": 5000000 } ``` --- **Prompt:** Quyidagi kompaniya nomlari ro‘yxatini tozalang va standart ko‘rinishga keltiring, dublikatlarni olib tashlang va har birini to‘g‘ri harf bilan yozing:\nalfa bank, Alfa Bank, ALFA bank, delta insurance, Delta Insurance, DELTA INSURANCE **Model:** * Alfa Bank * Delta Insurance --- ### Bilingual & Instruction Following **Prompt:** Bankda depozit ochishning asosiy afzalliklari nimalardan iborat? Iltimos, avval javobni o‘zbek tilida yozing, so‘ngra ingliz tiliga tarjima qiling. **Model:** O‘zbek tilida: ... Ingliz tilida: ... --- # Real-World Example: Bilingual Financial Q\&A **Prompt:** Bankda depozit ochishning asosiy afzalliklari nimalardan iborat? Iltimos, avval javobni o‘zbek tilida yozing, so‘ngra ingliz tiliga tarjima qiling. --- **Model Output:** ### O‘zbek tilida: 1. **Xavfsizlik**: Depozitlar bank tomonidan himoyalangan bo‘lib, pulingiz xavfsiz saqlanadi. 2. **Foizlar**: Banklar depozitlarga foiz to‘laydilar, bu sizga pulingizni uzoq muddat saqlashda qo‘shimcha daromad olishingizga yordam beradi. 3. **Likvidlik**: Depozitlar odatda bankka kirish mumkin bo‘lgan puldir, shuning uchun siz kerak bo‘lganda pulingizni tezda olish imkoniyatiga ega bo‘lasiz. 4. **Rejalashtirish imkoniyati**: Depozitlar sizga moliyaviy maqsadlaringizni rejalashtirish va moliyaviy barqarorlikni ta'minlashda yordam beradi. 5. **Kredit olish imkoniyati**: Ba'zi banklar depozitlar orqali kreditlar olish imkoniyatini taklif qiladi, bu sizga moliyaviy ehtiyojlaringizni qondirishda yordam beradi. ### Ingliz tilida: 1. **Security**: Deposits are protected by the bank, ensuring that your money is safe. 2. **Interest**: Banks pay interest on your deposits, helping you earn additional income while keeping your money safe for a longer period. 3. **Liquidity**: Deposits are usually cash that can be accessed easily, allowing you to retrieve your money whenever you need it. 4. **Planning**: Deposits help you plan your financial goals and maintain financial stability. 5. **Credit Access**: Some banks offer the ability to obtain credit through deposits, helping you meet your financial needs. --- ## 🏋️ Training Details * **Base Model:** [microsoft/phi-4-mini-instruct](https://huggingface.co/microsoft/phi-4-mini-instruct) * **LoRA/PEFT fine-tuning:** Efficient adaptation for resource-constrained hardware * **Datasets used:** * [Finance-Instruct-500k](https://huggingface.co/datasets/Josephgflowers/Finance-Instruct-500k) (English/Chinese/other) * Uzbek news, Wikipedia, and finance filtered corpora * Multi-language and translation QA datasets (Uzbek focus) * Functional datasets: entity extraction, JSON parsing, summarization, tabular math * yakhyo/uz-news * yakhyo/uz-wiki * behbudiy/alpaca-cleaned-uz * Josephgflowers/Finance_Curriculum_Edu_English * Josephgflowers/Finance-Curriculum-Edu-Uzbek * **Sequence length:** 4096 tokens * **Batching:** 4 grad accumulation, per-device batch 1 * **Learning rate:** 2e-4 * **Other:** See repo for detailed script and data configs --- ## ✅ Intended Use Cases * Financial Q\&A and knowledge base in Uzbek and English * Financial modeling, calculations, and reasoning in Uzbek * Automated financial document analysis (entity extraction, parsing, summarization) * Bilingual education, content creation, and translation for Uzbek finance --- ## ⚠️ Limitations & Warnings * Not a substitute for licensed financial/legal advice * Tabular/math accuracy may still lag specialized English LLMs for highly complex cases * Not suitable for real-time financial trading or compliance decisions * May occasionally hallucinate facts or calculations—always check outputs for critical use! --- ## 📈 Benchmarks / Example Comparisons **Dramatic performance improvement over base phi-4-mini-instruct:** * *Base model* produces garbled, repetitive, or nonsensical Uzbek on financial and reasoning tasks * *Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1* generates concise, accurate, professional Uzbek --- ## 👤 Author & Attribution Created by [Josephgflowers](https://huggingface.co/Josephgflowers) Special thanks to the open-source LLM and Uzbek NLP community --- ## 📝 How to Cite ``` @misc{Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1, author = {Joseph Flowers}, title = {Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1: Instruction-Tuned LLM for Uzbek Finance and Bilingual NLP}, year = {2024}, howpublished = {\url{https://huggingface.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1}} } ``` --- ## 📬 Contact & Contributions Open to feedback, dataset suggestions, or collaboration—open an issue or discussion on the [Hugging Face model page](https://huggingface.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-uzbek-multilingual-v1) or message [Josephgflowers](https://huggingface.co/Josephgflowers). --- *Model card last updated: 2024-07-29.*