Datasets:
File size: 15,001 Bytes
e9e3ac1 6c45184 f2a55f5 e9e3ac1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
---
configs:
- config_name: yelpreview
data_files:
- split: train
path: "yelpdata.parquet"
task_categories:
- summarization
language:
- en
size_categories:
- 100B<n<1T
---
# Dataset Card for Yelp Resturant Dataset
## Dataset Description
### Dataset Access
- [Yelp Raw Data Download Link](https://www.yelp.com/dataset/download)
- [Yelp Restaurant Training Dataset](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_train.csv)
- [Yelp Restaurant Testing Dataset](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_test.csv)
### Raw Dataset Summary
Yelp raw data encompasses a wealth of information from the Yelp platform, detailing user reviews, business ratings, and operational specifics across a diverse array of local establishments.
To be more specific, yelp raw dataset contains **five different JSON datasets**:
- `yelp_academic_dataset_business.json` (118.9MB)
This file contains information about businesses listed on Yelp. Each record in this dataset typically includes the business's name, address, city, state, postal code, latitude and longitude, stars (average rating), review count, categories (e.g., Restaurants, Shopping, etc.), and other attributes like parking availability or if it's wheelchair accessible.
- `yelp_academic_dataset_checkin.json` (287MB)
The checkin file provides data on check-ins at businesses by users over time. It includes the business ID and a series of timestamps indicating when users checked in at that location, offering insights into the popularity of the business at different times and days.
- `yelp_academic_dataset_review.json` (5.34GB)
This dataset contains reviews written by users for businesses. Each review includes the user ID, business ID, stars given (1 to 5), useful/funny/cool votes, the text of the review, and the date it was posted. This data can be used to analyze customer sentiment, evaluate service quality, and more.
- `yelp_academic_dataset_tip.json` (180.6MB)
Tips are short messages left by users about a business, often containing suggestions, compliments, or advice for future customers. This file includes information such as the text of the tip, the date it was left, the business ID, and the user ID. Tips provide quick, insightful feedback about a business.
- `yelp_academic_dataset_user.json` (3.36GB)
This file contains data about Yelp users, including their user ID, name, review count, yelping since (the date they joined Yelp), friends (a list of user IDs representing their friends on Yelp), useful/funny/cool vote counts they've received, fans (the number of users who've marked them as a "fan"), and their average stars given. It can be used to analyze user behavior, social networks, and influence on Yelp.
### Language
The Yelp dataset is primarily composed of English language text for its reviews, business information, and user interactions.
## Dataset Process
In this project, we will try only use
[`yelp_academic_dataset_business.json`](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_academic_dataset_business.json)
and [`yelp_academic_dataset_review.json`](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_academic_dataset_review.json). (You can check the json files by clicking the links.)
And we will focus solely on restaurants, so we will follow these steps to get our target datasets:
- Load `yelp_academic_dataset_business.json` and `yelp_academic_dataset_review.json` as pandas DataFrames.
- Perform an inner merge of these datasets based on `business_id` and filter out businesses that are not restaurants (filter out rows that `categories` doesn't contain "restaurants").
- Split the yelp restaurants dataset into a training dataset and a testing dataset by shuffling the dataset and then spliting it by 80/20.
- Finally, we get yelp restaurants [training](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_train.csv) and [testing](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_test.csv) datasets in CSV format.
(You may check the data processing by this link: [Data Process Colab Link](https://colab.research.google.com/drive/1r_gUGmsawwtFpZCj23X1jWjfEi6Dw291?usp=sharing))
## Restaurant Dataset
### Restaurant Dataset Summary
- `yelp_train.csv`
This dataset provides a detailed overview of businesses, focusing on aspects such as location, ratings, and customer reviews. It contains columns that identify each business, its geographical information, and metrics indicating its performance, such as aggregate ratings and review counts. Additionally, it includes specifics about the types of services and cuisines offered, operational hours, and detailed customer reviews with ratings, usefulness, humor, and coolness indicators, as well as the text content of the reviews and their posting dates. This dataset includes 3,779,578 rows and it is 6.7 GB.
- `yelp_test.csv`
This dataset provides the same information as `yelp_train.csv`, but it includes 944,895 rows and it is 1.7 GB.
### Supposed Tasks
- Sentiment Analysis: By examining the textual reviews, natural language processing can be used to gauge customer sentiment towards businesses, categorizing opinions into positive, negative, or neutral sentiments.
- Rating Prediction: Machine learning models can leverage user and business attributes to predict the potential ratings a business might receive, helping in understanding factors that influence customer satisfaction.
- Business Analytics: Analysis of business performance metrics such as average ratings, review counts, and operational status can inform business owners about their market standing and customer perceptions.
- Recommendation Systems: The data can feed into recommendation algorithms to suggest businesses to users based on their preferences, previous ratings, and similar user behavior.
### Restaurant Dataset Structure
#### Variables
- business_id: A unique identifier for each business listed in the dataset. (non-null, object)
- name: The name of the business. (non-null, object)
- address: The street address of the business. (non-null, object)
- city: The city where the business is located. (non-null, object)
- state: The state or region where the business is located. (non-null, object)
- postal_code: The postal code associated with the business location. (non-null, object)
- latitude: The latitude coordinate of the business for geographical mapping. (non-null, float64)
- longitude: The longitude coordinate of the business for geographical mapping. (non-null, float64)
- stars_x: The average star rating of the business. (non-null, float64)
- review_count: The number of reviews the business has received. (non-null, int64)
- is_open: A binary variable indicating whether the business is open (1) or closed (0). (non-null, int64)
- attributes: A collection of attributes about the business, like 'Accepts Credit Cards', 'Parking', 'Wi-Fi', etc. (with missing values 493 rows if total 200,000 rows, object)
- categories: The categories the business falls under, such as 'Restaurants', 'Food',’Coffee’, etc. (non-null, object)
- hours: The hours of operation for the business. (with missing values 6,905 rows if total 200,000 rows, object)
- review_id: A unique identifier for each review. (non-null, object)
- user_id: A unique identifier for each user who has left a review. (non-null, object)
- stars_y: The star rating given by the user in their review. (non-null, float64)
- useful: The number of users who found the review useful. (non-null, int64)
- funny: The number of users who found the review funny. (non-null, int64)
- cool: The number of users who found the review cool. (non-null, int64)
- text: The text content of the review. (non-null, object)
- date: The date when the review was posted. (non-null, object)
#### Variables Instances
```
{
"business_id":"MTSW4McQd7CbVtyjqoe9mw",
"name":"St Honore Pastries",
"address":"935 Race St",
"city":"Philadelphia",
"state":"PA",
"postal_code":"19107",
"latitude":39.9555052,
"longitude":-75.1555641,
"stars_x":4.0,
"review_count":80,
"is_open":1,
"attributes":{
"RestaurantsDelivery":"False",
"OutdoorSeating":"False",
"BusinessAcceptsCreditCards":"False",
"BusinessParking":"{'garage': False, 'street': True, 'validated': False, 'lot': False, 'valet': False}",
"BikeParking":"True",
"RestaurantsPriceRange2":"1",
"RestaurantsTakeOut":"True",
"ByAppointmentOnly":"False",
"WiFi":"u'free'",
"Alcohol":"u'none'",
"Caters":"True"
},
"categories":"Restaurants, Food, Bubble Tea, Coffee & Tea, Bakeries",
"hours":{
"Monday":"7:0-20:0",
"Tuesday":"7:0-20:0",
"Wednesday":"7:0-20:0",
"Thursday":"7:0-20:0",
"Friday":"7:0-21:0",
"Saturday":"7:0-21:0",
"Sunday":"7:0-21:0"
},
"review_id":"BXQcBN0iAi1lAUxibGLFzA",
"user_id":"6_SpY41LIHZuIaiDs5FMKA",
"stars_y":4.0,
"useful":0,
"funny":0,
"cool":1,
"text":"This is nice little Chinese bakery in the heart of Philadelphia's Chinatown! The female cashier was very friendly (flirtatious!) and the pastries shown in nicely adorned display cases. I stopped by early one evening had a sesame ball, which was filled with bean paste. The glutinous rice of the ball was nicely flavored, similar to Bai Tang Gao. Definitely as place worth stopping at if you are in the area.",
"date":"2014-05-26 01:09:53"
}
```
### Usage
The dataset is compatible with the Hugging Face `datasets` library. The dataset class `YelpDataset` provides methods to access the structured data efficiently, including features detailing business information, user reviews, and user profiles.
### Getting Started
To start working with the Yelp Dataset in Python, ensure you have the Hugging Face `datasets` library installed. Then, you can load the dataset using the `YelpDataset` class provided in the script. Here's a quick example:
```
from datasets import load_dataset
dataset = load_dataset("Johnnyeee/Yelpdata_663", trust_remote_code=True)
```
This will give you a quick glimpse into the structure and content of the dataset, ready for your analysis or model training tasks.
You can also generate a training dataset example by:
```
next(iter((dataset['train'])))
```
A testing dataset example
```
next(iter((dataset['test'])))
```
You can check this Colab link to find out more details: [Link*](https://colab.research.google.com/drive/1B5Jd_-ZtkouRcu3DeOm3Nz6sWH_-w4lj?usp=sharing)
## Dataset Creation
### Curation Rationale
The dataset includes a variety of data types (e.g., business information, reviews, user data, check-ins, and tips), enabling a wide range of research topics and studies in areas such as natural language processing, social network analysis, recommender systems, and geographic information systems.
By providing data from an active and popular platform, the dataset offers insights into real-world consumer behavior, business trends, and social interactions. This relevance makes it an excellent resource for studies aiming to understand or model aspects of the contemporary economy and society.
By making the dataset publicly available for academic and educational purposes, Yelp aims to contribute to the broader academic community. It lowers barriers for researchers and educators who might not have access to large-scale, real-world data.
## Considerations
### Bias
- Geographic Bias: Yelp's presence and popularity vary significantly across different regions. If the dataset has more extensive coverage in certain areas, the analysis might not accurately reflect regions with lower Yelp usage, leading to skewed insights about restaurant preferences or trends.
- User Demographic Bias: Yelp users may not be a representative sample of the broader population. Factors such as age, income, and tech-savviness can influence who uses Yelp and who writes reviews. This skew can affect the perceived quality or popularity of restaurants.
- Selection Bias: By focusing solely on restaurants and the first 200,000 rows of the merged dataset, there's a risk of omitting relevant data that could offer a more comprehensive understanding of consumer preferences or business performance. The initial selection process might also favor certain types of restaurants or those with more reviews, skewing the analysis.
- Rating Bias: Users who leave reviews might be more likely to do so after exceptionally positive or negative experiences, which doesn't always accurately reflect the average customer experience. This can lead to a polarization of ratings, where the data might not accurately represent the overall quality of service.
### Limitations
- Data Completeness: The dataset might not capture all restaurants or reviews, especially newer businesses or those that have not been reviewed on Yelp. This incompleteness can limit the analysis's scope and the accuracy of findings.
- Temporal Dynamics: Consumer preferences and restaurant quality can change over time. The dataset represents a snapshot, and without considering the time aspect, it might not accurately reflect current trends or the impact of external events (e.g., a pandemic).
- Memory Constraints: Limiting the analysis to the first 200,000 rows to manage memory usage could introduce sample bias, as this approach does not guarantee a random or representative sample of the entire dataset. This constraint might overlook valuable insights from the excluded data.
- Lack of External Data: By not incorporating external data sources, such as economic indicators, health inspection scores, or social media sentiment, the analysis might miss out on important factors that could influence restaurant performance or consumer preferences.
- Data Privacy and Ethics: While the dataset is curated for academic use, there's always a concern regarding user privacy and the ethical use of data, particularly in how user-generated content is analyzed and interpreted.
### Dataset Terms of Use
Yelp's dataset comes with a detailed set of terms of use, which you can review by visiting their Dataset User Agreement. The agreement can be found at the provided link: [Yelp Dataset User Agreement](https://s3-media0.fl.yelpcdn.com/assets/srv0/engineering_pages/f64cb2d3efcc/assets/vendor/Dataset_User_Agreement.pdf). This document will contain specific guidelines and restrictions that are crucial for anyone working with Yelp's dataset.
# Links
All relative links:
- Yelp raw dataset: https://www.yelp.com/dataset/download
- yelp_academic_dataset_business.json:https://yelpdata.s3.us-west-2.amazonaws.com/yelp_academic_dataset_business.json
- yelp_academic_dataset_review.json:https://yelpdata.s3.us-west-2.amazonaws.com/yelp_academic_dataset_review.json
- Yelp Restaurant training dataset: https://yelpdata.s3.us-west-2.amazonaws.com/yelp_train.csv
- Yelp Restaurant testing dataset: https://yelpdata.s3.us-west-2.amazonaws.com/yelp_test.csv
- Data Processing: https://colab.research.google.com/drive/1r_gUGmsawwtFpZCj23X1jWjfEi6Dw291?usp=sharing
- Setup and check: https://colab.research.google.com/drive/1B5Jd_-ZtkouRcu3DeOm3Nz6sWH_-w4lj?usp=sharing |