Mel Seto
commited on
Commit
·
fb3f6ab
1
Parent(s):
6c0764e
update readme
Browse files
README.md
CHANGED
|
@@ -13,4 +13,50 @@ hf_oauth_scopes:
|
|
| 13 |
- inference-api
|
| 14 |
---
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
- inference-api
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# 🀄 Chinese Idiom Finder
|
| 17 |
+
|
| 18 |
+
An interactive app to discover and learn **Chinese idioms (成语, 俗语, 谚语)**.
|
| 19 |
+
Given a situation, the app suggests a relevant idiom, provides **pinyin**, a **literal English translation**, and a **concise explanation**.
|
| 20 |
+
|
| 21 |
+
👉 Live Demo: [Chinese Idiom Finder on Hugging Face Spaces](https://huggingface.co/spaces/chinese-enthusiasts/idiom-finder)
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## ✨ Features
|
| 26 |
+
- 🔍 **Idiom generation** using an LLM (OpenAI-compatible model).
|
| 27 |
+
- ✅ **Idiom verification** using:
|
| 28 |
+
- [ChID dataset](https://arxiv.org/abs/1906.01265) (Chinese Idiom Dataset)
|
| 29 |
+
- CC-CEDICT (open Chinese–English dictionary)
|
| 30 |
+
- Wiktionary (fallback)
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## 🚀 How It Works
|
| 35 |
+
1. User inputs a situation (e.g. *“When you stay calm under pressure”*).
|
| 36 |
+
2. The LLM generates an idiom suggestion.
|
| 37 |
+
3. The idiom is verified against datasets/dictionaries.
|
| 38 |
+
4. Output includes:
|
| 39 |
+
- Idiom in Chinese
|
| 40 |
+
- Pinyin
|
| 41 |
+
- Literal translation
|
| 42 |
+
- Concise explanation
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## 🛠️ Tech Stack
|
| 47 |
+
- [Gradio](https://www.gradio.app/) (frontend)
|
| 48 |
+
- Hugging Face Spaces (deployment)
|
| 49 |
+
- OpenAI-compatible LLM API
|
| 50 |
+
- Python (requests, pypinyin, etc.)
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## 🖥️ Local Development
|
| 55 |
+
|
| 56 |
+
Clone the repo and run locally:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
git clone https://huggingface.co/spaces/chinese-enthusiasts/idiom-finder
|
| 60 |
+
cd idiom-finder
|
| 61 |
+
pip install -r requirements.txt
|
| 62 |
+
python app.py
|