Update app.py
Browse files
app.py
CHANGED
|
@@ -185,7 +185,7 @@ def complete_address_interface(partial_address):
|
|
| 185 |
return "β Model not loaded. Please check the logs."
|
| 186 |
|
| 187 |
result = llama_system.complete_partial_address(partial_address)
|
| 188 |
-
return f"**Partial Address:** {partial_address}\n\n**Completed Address:**\n{result}"
|
| 189 |
|
| 190 |
def standardize_address_interface(address_text):
|
| 191 |
"""Interface function for address standardization"""
|
|
@@ -193,7 +193,7 @@ def standardize_address_interface(address_text):
|
|
| 193 |
return "β Model not loaded. Please check the logs."
|
| 194 |
|
| 195 |
result = llama_system.standardize_address(address_text)
|
| 196 |
-
return f"**Original:** {address_text}\n\n**Standardized:**\n{result}"
|
| 197 |
|
| 198 |
# Sample data
|
| 199 |
sample_addresses = [
|
|
@@ -224,13 +224,16 @@ with gr.Blocks(title="Llama Address Intelligence", theme=gr.themes.Soft()) as de
|
|
| 224 |
gr.Markdown("""
|
| 225 |
# π¦ Llama 3.2-1B Address Intelligence
|
| 226 |
|
| 227 |
-
Powered by a fine-tuned Llama 3.2-1B model specialized for Indian address processing.
|
|
|
|
|
|
|
|
|
|
| 228 |
|
| 229 |
**Model:** [shiprocket-ai/open-llama-1b-address-completion](https://huggingface.co/shiprocket-ai/open-llama-1b-address-completion)
|
| 230 |
""")
|
| 231 |
|
| 232 |
with gr.Tab("π Extract Components"):
|
| 233 |
-
gr.Markdown("Extract structured components from complete addresses")
|
| 234 |
with gr.Row():
|
| 235 |
with gr.Column(scale=1):
|
| 236 |
extract_input = gr.Textbox(
|
|
@@ -265,7 +268,7 @@ with gr.Blocks(title="Llama Address Intelligence", theme=gr.themes.Soft()) as de
|
|
| 265 |
)
|
| 266 |
|
| 267 |
with gr.Tab("β¨ Complete Address"):
|
| 268 |
-
gr.Markdown("Complete partial
|
| 269 |
with gr.Row():
|
| 270 |
with gr.Column(scale=1):
|
| 271 |
complete_input = gr.Textbox(
|
|
@@ -300,7 +303,7 @@ with gr.Blocks(title="Llama Address Intelligence", theme=gr.themes.Soft()) as de
|
|
| 300 |
)
|
| 301 |
|
| 302 |
with gr.Tab("π Standardize Format"):
|
| 303 |
-
gr.Markdown("Convert informal
|
| 304 |
with gr.Row():
|
| 305 |
with gr.Column(scale=1):
|
| 306 |
standardize_input = gr.Textbox(
|
|
@@ -363,6 +366,13 @@ with gr.Blocks(title="Llama Address Intelligence", theme=gr.themes.Soft()) as de
|
|
| 363 |
- **Road Names**: Streets, lanes, main roads
|
| 364 |
- **Landmarks**: Notable reference points
|
| 365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
### Use Cases
|
| 367 |
- **E-commerce**: Auto-complete checkout addresses
|
| 368 |
- **Forms**: Intelligent address suggestions
|
|
|
|
| 185 |
return "β Model not loaded. Please check the logs."
|
| 186 |
|
| 187 |
result = llama_system.complete_partial_address(partial_address)
|
| 188 |
+
return f"**Partial Address:** {partial_address}\n\n**Completed Address:**\n{result}\n\n*β οΈ Note: This feature has limited training data and results may vary in quality.*"
|
| 189 |
|
| 190 |
def standardize_address_interface(address_text):
|
| 191 |
"""Interface function for address standardization"""
|
|
|
|
| 193 |
return "β Model not loaded. Please check the logs."
|
| 194 |
|
| 195 |
result = llama_system.standardize_address(address_text)
|
| 196 |
+
return f"**Original:** {address_text}\n\n**Standardized:**\n{result}\n\n*β οΈ Note: This feature has limited training data and results may vary in quality.*"
|
| 197 |
|
| 198 |
# Sample data
|
| 199 |
sample_addresses = [
|
|
|
|
| 224 |
gr.Markdown("""
|
| 225 |
# π¦ Llama 3.2-1B Address Intelligence
|
| 226 |
|
| 227 |
+
Powered by a fine-tuned Llama 3.2-1B model specialized for Indian address processing.
|
| 228 |
+
|
| 229 |
+
**β Best Performance**: Entity extraction from complete addresses
|
| 230 |
+
**β οΈ Limited Performance**: Address completion and standardization (limited training data)
|
| 231 |
|
| 232 |
**Model:** [shiprocket-ai/open-llama-1b-address-completion](https://huggingface.co/shiprocket-ai/open-llama-1b-address-completion)
|
| 233 |
""")
|
| 234 |
|
| 235 |
with gr.Tab("π Extract Components"):
|
| 236 |
+
gr.Markdown("β **BEST PERFORMANCE** - Extract structured components from complete addresses")
|
| 237 |
with gr.Row():
|
| 238 |
with gr.Column(scale=1):
|
| 239 |
extract_input = gr.Textbox(
|
|
|
|
| 268 |
)
|
| 269 |
|
| 270 |
with gr.Tab("β¨ Complete Address"):
|
| 271 |
+
gr.Markdown("β οΈ **EXPERIMENTAL** - Complete partial addresses (limited training data - results may vary)")
|
| 272 |
with gr.Row():
|
| 273 |
with gr.Column(scale=1):
|
| 274 |
complete_input = gr.Textbox(
|
|
|
|
| 303 |
)
|
| 304 |
|
| 305 |
with gr.Tab("π Standardize Format"):
|
| 306 |
+
gr.Markdown("β οΈ **EXPERIMENTAL** - Convert informal addresses to standardized format (limited training data - results may vary)")
|
| 307 |
with gr.Row():
|
| 308 |
with gr.Column(scale=1):
|
| 309 |
standardize_input = gr.Textbox(
|
|
|
|
| 366 |
- **Road Names**: Streets, lanes, main roads
|
| 367 |
- **Landmarks**: Notable reference points
|
| 368 |
|
| 369 |
+
### Performance Notes
|
| 370 |
+
- **β Entity Extraction**: Excellent performance - primary use case
|
| 371 |
+
- **β οΈ Address Completion**: Limited training data - experimental feature
|
| 372 |
+
- **β οΈ Format Standardization**: Limited training data - experimental feature
|
| 373 |
+
|
| 374 |
+
**Recommendation**: Use this model primarily for address component extraction.
|
| 375 |
+
|
| 376 |
### Use Cases
|
| 377 |
- **E-commerce**: Auto-complete checkout addresses
|
| 378 |
- **Forms**: Intelligent address suggestions
|