πΊοΈ bert-trip-plan: Trip Planning Entity Recognition πβοΈπ
π Overview
bert-trip-plan
is a BERT-based model fine-tuned specifically for Trip Planning Entity Recognition (NER) π§. It accurately extracts key entities like "From", "To", and "Mode" from natural language travel queries, making it ideal for use in travel assistants π€, chatbots π¬, and navigation systems πΊοΈ.
π― Example
- Input: "I want to travel from New York to Chicago by train."
- Output:
- π "New York" β
From
- π "Chicago" β
To
- π "train" β
Mode
- π "New York" β
π Key Features
β¨ Feature | π Description |
---|---|
π― Task | Named Entity Recognition (NER) specialized for trip planning queries. |
π Extracted Entities | From (origin), To (destination), and Mode (transportation method). |
π€ Model | BERT fine-tuned for token classification tasks. |
π Language | English |
π οΈ Usage
You can easily integrate bert-trip-plan
with Hugging Faceβs Transformers library. Below are two examples demonstrating how to use the model.
β Basic Example
from transformers import pipeline
# π€ Load the model
ner_pipeline = pipeline("token-classification", model="boltuix/bert-trip-plan", aggregation_strategy="simple")
# π Input travel query
query = "I want to travel from New York to Chicago by train."
# π§ Perform NER
results = ner_pipeline(query)
# π€ Display extracted entities
print(results)
π Sample Output
[
{"entity_group": "from_loc", "word": "New York", "score": 0.999},
{"entity_group": "to_loc", "word": "Chicago", "score": 0.998},
{"entity_group": "transport_mode", "word": "train", "score": 0.997}
]
π‘ Trip Planning Example
from transformers import pipeline
import json
# π Load the NER model for trip planning
ner_pipeline = pipeline("token-classification", model="boltuix/bert-trip-plan", aggregation_strategy="simple")
# π§Ύ Input query
query = "plan a trip to New York from San Francisco by flight"
# π§ Perform Named Entity Recognition
results = ner_pipeline(query)
# π¦ Initialize output dictionary
output = {
'from': '',
'to': '',
'mode': ''
}
# π§Ή Extract entities
for item in results:
entity = item['entity_group']
word = item['word'].strip('.').strip()
if entity == 'from_loc':
output['from'] = word
elif entity == 'to_loc':
output['to'] = word
elif entity == 'transport_mode':
output['mode'] = word
# π¨οΈ Print structured output
print(json.dumps(output, indent=2))
π£ Let us know if you want to see:
- π A live demo
- βοΈ API integration
- 𧩠UI wrapper with Gradio or Streamlit
- π Evaluation metrics & benchmark comparisons
Happy Planning! πβοΈππ§³
- Downloads last month
- 191
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support
Model tree for boltuix/bert-trip-plan
Base model
prajjwal1/bert-mini