Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,120 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
task_categories:
|
4 |
+
- question-answering
|
5 |
+
- text-retrieval
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
tags:
|
9 |
+
- vector search
|
10 |
+
- semantic search
|
11 |
+
- retrieval augmented generation
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
---
|
15 |
+
|
16 |
+
## Overview
|
17 |
+
|
18 |
+
This dataset consists of AirBnB listings consisting of property descriptions, reviews and other metadata.
|
19 |
+
|
20 |
+
We also provide embeddings (using OpenAI's text-embedding-small model) of the property description so you can use this dataset for building Search and RAG applications.
|
21 |
+
|
22 |
+
## Dataset Structure
|
23 |
+
|
24 |
+
Here is a full list of fields contained in the dataset. Some noteworthy fields have been highlighted:
|
25 |
+
|
26 |
+
- _id: Unique identifier for the listing
|
27 |
+
- listing_url: URL for the listing on AirBnB
|
28 |
+
- **name**: Title or name of the listing
|
29 |
+
- **summary**: Short overview of listing
|
30 |
+
- **space**: Short description of the space, amenities etc.
|
31 |
+
- **description**: Full listing description
|
32 |
+
- neighborhood_overview: Description of surrounding area
|
33 |
+
- notes: Special instructions or notes
|
34 |
+
- transit: Nearby public transportation options
|
35 |
+
- access: How to access the property. Door codes etc.
|
36 |
+
- interaction: Host's preferred interaction medium
|
37 |
+
- house_rules: Rules guests must follow
|
38 |
+
- **property_type**: Type of property
|
39 |
+
- room_type: Listing's room category
|
40 |
+
- bed_type: Type of bed provided
|
41 |
+
- minimum_nights: Minimum stay required
|
42 |
+
- maximum_nights: Maximum stay allowed
|
43 |
+
- cancellation_policy: Terms for cancelling booking
|
44 |
+
- first_review: Date of first review
|
45 |
+
- last_review: Date of latest review
|
46 |
+
- **accommodates**: Number of guests accommodated
|
47 |
+
- **bedrooms**: Number of bedrooms available
|
48 |
+
- **beds**: Number of beds available
|
49 |
+
- number_of_reviews: Total reviews received
|
50 |
+
- bathrooms: Number of bathrooms available
|
51 |
+
- **amenities**: List of amenities offered
|
52 |
+
- **price**: Nightly price for listing
|
53 |
+
- security_deposit: Required security deposit amount
|
54 |
+
- cleaning_fee: Additional cleaning fee charged
|
55 |
+
- extra_people: Fee for additional guests
|
56 |
+
- guests_included: Number of guests included in the base price
|
57 |
+
- **images**: Links to listing images
|
58 |
+
- host: Information about the host
|
59 |
+
- **address**: Physical address of listing
|
60 |
+
- **availability**: Availability dates for listing
|
61 |
+
- **review_scores**: Aggregate review scores
|
62 |
+
- reviews: Individual guest reviews
|
63 |
+
- weekly_price: Discounted price for week
|
64 |
+
- monthly_price: Discounted price for month
|
65 |
+
- reviews_per_month: Average monthly review count
|
66 |
+
- **space_embeddings**: Embeddings of the property description in the `space` field
|
67 |
+
|
68 |
+
## Usage
|
69 |
+
|
70 |
+
This dataset can be useful for:
|
71 |
+
- Building Hybrid Search applications. Combine vector search using the embeddings provided, with full text search using the exhaustive list of metadata fields.
|
72 |
+
- Building Multimodal Search applications. Some listings have images associated with them. Use a model like [CLIP](https://huggingface.co/openai/clip-vit-base-patch32) to generate image and text emebeddings.
|
73 |
+
- Building RAG applications
|
74 |
+
|
75 |
+
## Ingest Data
|
76 |
+
|
77 |
+
To experiment with this dataset using MongoDB Atlas, first [create a MongoDB Atlas account](https://www.mongodb.com/cloud/atlas/register?utm_campaign=devrel&utm_source=community&utm_medium=organic_social&utm_content=Hugging%20Face%20Dataset&utm_term=apoorva.joshi).
|
78 |
+
|
79 |
+
You can then use the following script to load this dataset into your MongoDB Atlas cluster:
|
80 |
+
|
81 |
+
```
|
82 |
+
import os
|
83 |
+
from pymongo import MongoClient
|
84 |
+
import datasets
|
85 |
+
from datasets import load_dataset
|
86 |
+
from bson import json_util
|
87 |
+
|
88 |
+
# MongoDB Atlas URI and client setup
|
89 |
+
uri = os.environ.get('MONGODB_ATLAS_URI')
|
90 |
+
client = MongoClient(uri)
|
91 |
+
|
92 |
+
# Change to the appropriate database and collection names
|
93 |
+
db_name = 'your_database_name' # Change this to your actual database name
|
94 |
+
collection_name = 'airbnb_embeddings' # Change this to your actual collection name
|
95 |
+
|
96 |
+
collection = client[db_name][collection_name]
|
97 |
+
|
98 |
+
# Load the "airbnb_embeddings" dataset from Hugging Face
|
99 |
+
dataset = load_dataset("MongoDB/airbnb_embeddings")
|
100 |
+
|
101 |
+
insert_data = []
|
102 |
+
|
103 |
+
# Iterate through the dataset and prepare the documents for insertion
|
104 |
+
# The script below ingests 1000 records into the database at a time
|
105 |
+
for item in dataset['train']:
|
106 |
+
# Convert the dataset item to MongoDB document format
|
107 |
+
doc_item = json_util.loads(json_util.dumps(item))
|
108 |
+
insert_data.append(doc_item)
|
109 |
+
|
110 |
+
# Insert in batches of 1000 documents
|
111 |
+
if len(insert_data) == 1000:
|
112 |
+
collection.insert_many(insert_data)
|
113 |
+
print("1000 records ingested")
|
114 |
+
insert_data = []
|
115 |
+
|
116 |
+
# Insert any remaining documents
|
117 |
+
if len(insert_data) > 0:
|
118 |
+
collection.insert_many(insert_data)
|
119 |
+
print("Data Ingested")
|
120 |
+
```
|