Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,159 @@
|
|
| 1 |
---
|
| 2 |
title: Convert To Json
|
| 3 |
emoji: π¬π
π
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 5.33.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
short_description: Convert Free Text Into Json Using AI
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Convert To Json
|
| 3 |
emoji: π¬π
π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.33.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
short_description: Convert Free Text Into Json Using AI
|
| 12 |
---
|
| 13 |
|
| 14 |
+
youtube : https://youtu.be/PtWkJHNmo9k
|
| 15 |
+
|
| 16 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 17 |
+
# π Osmosis Structure - Text to JSON Converter
|
| 18 |
+
|
| 19 |
+
A powerful web application that converts unstructured text into well-formatted JSON using the Osmosis Structure 0.6B model. This tool is specifically designed for structured data extraction and format conversion tasks.
|
| 20 |
+
|
| 21 |
+
## π Features
|
| 22 |
+
|
| 23 |
+
- **Intelligent Text Processing**: Automatically identifies and extracts key information from unstructured text
|
| 24 |
+
- **Schema Support**: Optionally provide a JSON schema to structure the output according to your needs
|
| 25 |
+
- **Customizable Generation**: Fine-tune the output with adjustable parameters:
|
| 26 |
+
- Temperature
|
| 27 |
+
- Max tokens
|
| 28 |
+
- Top-p sampling
|
| 29 |
+
- Top-k sampling
|
| 30 |
+
- **User-Friendly Interface**: Clean and intuitive Gradio interface
|
| 31 |
+
- **Example Templates**: Pre-configured examples to help you get started
|
| 32 |
+
- **GPU Acceleration**: Optimized for GPU when available
|
| 33 |
+
|
| 34 |
+
## π Quick Start
|
| 35 |
+
|
| 36 |
+
1. Clone the repository:
|
| 37 |
+
```bash
|
| 38 |
+
git clone https://github.com/yourusername/Convert-to-Json.git
|
| 39 |
+
cd Convert-to-Json
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
2. Install dependencies:
|
| 43 |
+
```bash
|
| 44 |
+
pip install -r requirements.txt
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
3. Run the application:
|
| 48 |
+
```bash
|
| 49 |
+
python app.py
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## π» Usage
|
| 53 |
+
|
| 54 |
+
### Basic Usage
|
| 55 |
+
|
| 56 |
+
1. Enter your unstructured text in the input field
|
| 57 |
+
2. (Optional) Provide a JSON schema to structure the output
|
| 58 |
+
3. Adjust generation parameters if needed
|
| 59 |
+
4. Click "Convert" or press Enter
|
| 60 |
+
5. View the structured JSON output
|
| 61 |
+
|
| 62 |
+
### Example Input
|
| 63 |
+
|
| 64 |
+
```text
|
| 65 |
+
The conference will be held on June 10-12, 2024 at the Grand Hotel in San Francisco.
|
| 66 |
+
Registration fee is $500 for early bird (before May 1) and $650 for regular registration.
|
| 67 |
+
Contact info@conference.com for questions.
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
### Example Schema
|
| 71 |
+
|
| 72 |
+
```json
|
| 73 |
+
{
|
| 74 |
+
"type": "object",
|
| 75 |
+
"properties": {
|
| 76 |
+
"event_start_date": {
|
| 77 |
+
"type": "string",
|
| 78 |
+
"format": "date"
|
| 79 |
+
},
|
| 80 |
+
"event_end_date": {
|
| 81 |
+
"type": "string",
|
| 82 |
+
"format": "date"
|
| 83 |
+
},
|
| 84 |
+
"location": {
|
| 85 |
+
"type": "string"
|
| 86 |
+
},
|
| 87 |
+
"registration_fees": {
|
| 88 |
+
"type": "object",
|
| 89 |
+
"properties": {
|
| 90 |
+
"early_bird_price": {
|
| 91 |
+
"type": "number"
|
| 92 |
+
},
|
| 93 |
+
"regular_price": {
|
| 94 |
+
"type": "number"
|
| 95 |
+
},
|
| 96 |
+
"early_bird_deadline": {
|
| 97 |
+
"type": "string",
|
| 98 |
+
"format": "date"
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
"contact_email": {
|
| 103 |
+
"type": "string"
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
### Example Output
|
| 110 |
+
|
| 111 |
+
```json
|
| 112 |
+
{
|
| 113 |
+
"event_start_date": "2024-06-10",
|
| 114 |
+
"event_end_date": "2024-06-12",
|
| 115 |
+
"location": "Grand Hotel, San Francisco",
|
| 116 |
+
"registration_fees": {
|
| 117 |
+
"early_bird_price": 500.0,
|
| 118 |
+
"regular_price": 650.0,
|
| 119 |
+
"early_bird_deadline": "2024-05-01"
|
| 120 |
+
},
|
| 121 |
+
"contact_email": "info@conference.com"
|
| 122 |
+
}
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
## βοΈ Generation Parameters
|
| 126 |
+
|
| 127 |
+
- **Max Tokens**: Controls the maximum length of the generated output (default: 512)
|
| 128 |
+
- **Temperature**: Controls randomness in generation (default: 0.6)
|
| 129 |
+
- Lower values (e.g., 0.3) make output more focused and deterministic
|
| 130 |
+
- Higher values (e.g., 0.9) make output more diverse and creative
|
| 131 |
+
- **Top-p**: Nucleus sampling parameter (default: 0.95)
|
| 132 |
+
- **Top-k**: Number of highest probability tokens to consider (default: 20)
|
| 133 |
+
|
| 134 |
+
## π οΈ Technical Details
|
| 135 |
+
|
| 136 |
+
- **Model**: Osmosis Structure 0.6B parameters
|
| 137 |
+
- **Architecture**: Qwen3 (specialized for structured data)
|
| 138 |
+
- **Purpose**: Converting unstructured text to structured JSON format
|
| 139 |
+
- **Optimizations**: Fine-tuned for data extraction and format conversion tasks
|
| 140 |
+
|
| 141 |
+
## π€ Contributing
|
| 142 |
+
|
| 143 |
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
| 144 |
+
|
| 145 |
+
## π License
|
| 146 |
+
|
| 147 |
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
| 148 |
+
|
| 149 |
+
## π Acknowledgments
|
| 150 |
+
|
| 151 |
+
- Thanks to the Hugging Face team for their excellent tools and resources
|
| 152 |
+
- Special thanks to Yuvi Sharma and all the folks at Hugging Face for the community grant
|
| 153 |
+
|
| 154 |
+
## π Join Our Community
|
| 155 |
+
|
| 156 |
+
- Join our active builder's community on [Discord](https://discord.gg/qdfnvSPcqP)
|
| 157 |
+
- Follow us on [Hugging Face](https://huggingface.co/MultiTransformer)
|
| 158 |
+
- Check out our [GitHub](https://github.com/tonic-ai)
|
| 159 |
+
- Contribute to [MultiTonic](https://github.com/MultiTonic)
|