Banner

πŸ—ΊοΈ 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

🌟 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
Safetensors
Model size
11.1M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for boltuix/bert-trip-plan

Finetuned
(9)
this model

Dataset used to train boltuix/bert-trip-plan