Johnnyeee commited on
Commit
8d03e2d
1 Parent(s): 62b4a9e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +176 -1
README.md CHANGED
@@ -1 +1,176 @@
1
- Hello!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dataset Card for Yelp Resturant Dataset
2
+
3
+ ## Dataset Description
4
+
5
+ ### Dataset Access
6
+ - [Yelp Raw Data Download Link](https://www.yelp.com/dataset/download)
7
+ - [Yelp Restaurant Training Dataset](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_train.csv)
8
+ - [Yelp Restaurant Testing Dataset](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_test.csv)
9
+
10
+ ### Raw Dataset Summary
11
+ 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.
12
+
13
+ To be more specific, yelp raw dataset contains **five different JSON datasets**:
14
+ - `yelp_academic_dataset_business.json` (118.9MB)
15
+ 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.
16
+
17
+ - `yelp_academic_dataset_checkin.json` (287MB)
18
+ 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.
19
+
20
+ - `yelp_academic_dataset_review.json` (5.34GB)
21
+ 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.
22
+
23
+ - `yelp_academic_dataset_tip.json` (180.6MB)
24
+ 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.
25
+
26
+ - `yelp_academic_dataset_user.json` (3.36GB)
27
+ 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.
28
+
29
+ ### Language
30
+ The Yelp dataset is primarily composed of English language text for its reviews, business information, and user interactions.
31
+
32
+ ## Dataset Process
33
+ In this project, we will try only use
34
+ [`yelp_academic_dataset_business.json`](https://yelpdata.s3.us-west-2.amazonaws.com/yelp_academic_dataset_business.json)
35
+ 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.)
36
+
37
+ And we will focus solely on restaurants, so we will follow these steps to get our target datasets:
38
+ - Load `yelp_academic_dataset_business.json` and `yelp_academic_dataset_review.json` as pandas DataFrames.
39
+ - 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").
40
+ - Split the yelp restaurants dataset into a training dataset and a testing dataset by shuffling the dataset and then spliting it by 80/20.
41
+ - 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
42
+ (You may check the data processing by this link: [Data Process Colab Link](https://colab.research.google.com/drive/1r_gUGmsawwtFpZCj23X1jWjfEi6Dw291?usp=sharing))
43
+
44
+ ## Restaurant Dataset
45
+
46
+ ### Restaurant Dataset Summary
47
+ - `yelp_train.csv`
48
+ 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.
49
+ - `yelp_test.csv`
50
+ This dataset provides the same information as `yelp_train.csv`, but it includes 944,895 rows and it is 1.7 GB.
51
+
52
+ ### Supposed Tasks
53
+ - 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.
54
+ - 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.
55
+ - 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.
56
+ - Recommendation Systems: The data can feed into recommendation algorithms to suggest businesses to users based on their preferences, previous ratings, and similar user behavior.
57
+
58
+
59
+ ### Restaurant Dataset Structure
60
+ #### Variables
61
+ - business_id: A unique identifier for each business listed in the dataset. (non-null, object)
62
+ - name: The name of the business. (non-null, object)
63
+ - address: The street address of the business. (non-null, object)
64
+ - city: The city where the business is located. (non-null, object)
65
+ - state: The state or region where the business is located. (non-null, object)
66
+ - postal_code: The postal code associated with the business location. (non-null, object)
67
+ - latitude: The latitude coordinate of the business for geographical mapping. (non-null, float64)
68
+ - longitude: The longitude coordinate of the business for geographical mapping. (non-null, float64)
69
+ - stars_x: The average star rating of the business. (non-null, float64)
70
+ - review_count: The number of reviews the business has received. (non-null, int64)
71
+ - is_open: A binary variable indicating whether the business is open (1) or closed (0). (non-null, int64)
72
+ - 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)
73
+ - categories: The categories the business falls under, such as 'Restaurants', 'Food',’Coffee’, etc. (non-null, object)
74
+ - hours: The hours of operation for the business. (with missing values 6,905 rows if total 200,000 rows, object)
75
+ - review_id: A unique identifier for each review. (non-null, object)
76
+ - user_id: A unique identifier for each user who has left a review. (non-null, object)
77
+ - stars_y: The star rating given by the user in their review. (non-null, float64)
78
+ - useful: The number of users who found the review useful. (non-null, int64)
79
+ - funny: The number of users who found the review funny. (non-null, int64)
80
+ - cool: The number of users who found the review cool. (non-null, int64)
81
+ - text: The text content of the review. (non-null, object)
82
+ - date: The date when the review was posted. (non-null, object)
83
+
84
+ #### Variables Instances
85
+ ```
86
+ {
87
+ "business_id":"MTSW4McQd7CbVtyjqoe9mw",
88
+ "name":"St Honore Pastries",
89
+ "address":"935 Race St",
90
+ "city":"Philadelphia",
91
+ "state":"PA",
92
+ "postal_code":"19107",
93
+ "latitude":39.9555052,
94
+ "longitude":-75.1555641,
95
+ "stars_x":4.0,
96
+ "review_count":80,
97
+ "is_open":1,
98
+ "attributes":{
99
+ "RestaurantsDelivery":"False",
100
+ "OutdoorSeating":"False",
101
+ "BusinessAcceptsCreditCards":"False",
102
+ "BusinessParking":"{'garage': False, 'street': True, 'validated': False, 'lot': False, 'valet': False}",
103
+ "BikeParking":"True",
104
+ "RestaurantsPriceRange2":"1",
105
+ "RestaurantsTakeOut":"True",
106
+ "ByAppointmentOnly":"False",
107
+ "WiFi":"u'free'",
108
+ "Alcohol":"u'none'",
109
+ "Caters":"True"
110
+ },
111
+ "categories":"Restaurants, Food, Bubble Tea, Coffee & Tea, Bakeries",
112
+ "hours":{
113
+ "Monday":"7:0-20:0",
114
+ "Tuesday":"7:0-20:0",
115
+ "Wednesday":"7:0-20:0",
116
+ "Thursday":"7:0-20:0",
117
+ "Friday":"7:0-21:0",
118
+ "Saturday":"7:0-21:0",
119
+ "Sunday":"7:0-21:0"
120
+ },
121
+ "review_id":"BXQcBN0iAi1lAUxibGLFzA",
122
+ "user_id":"6_SpY41LIHZuIaiDs5FMKA",
123
+ "stars_y":4.0,
124
+ "useful":0,
125
+ "funny":0,
126
+ "cool":1,
127
+ "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.",
128
+ "date":"2014-05-26 01:09:53"
129
+ }
130
+ ```
131
+ ### Usage
132
+ 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.
133
+
134
+ ### Getting Started
135
+ 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:
136
+ ```
137
+ from datasets import load_dataset
138
+
139
+ dataset = load_dataset("Johnnyeee/Yelpdata_663", trust_remote_code=True)
140
+ ```
141
+ This will give you a quick glimpse into the structure and content of the dataset, ready for your analysis or model training tasks.
142
+
143
+ You can also generate a training dataset example by:
144
+ ```
145
+ next(iter((dataset['train'])))
146
+ ```
147
+ A testing dataset example
148
+ ```
149
+ next(iter((dataset['test'])))
150
+ ```
151
+ ## Dataset Creation
152
+ ### Curation Rationale
153
+ 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.
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ ## Considerations
160
+ ### Bias
161
+ - 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.
162
+ - 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.
163
+ - 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.
164
+ - 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.
165
+
166
+ ### Limitations
167
+ - 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.
168
+ - 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).
169
+ - 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.
170
+ - 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.
171
+ - 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.
172
+
173
+ ### Dataset Terms of Use
174
+ 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.
175
+
176
+