J94 commited on
Commit
9e0b3ba
·
verified ·
1 Parent(s): 509b507

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +53 -0
  2. analyze_bookmarks.py +108 -0
  3. data.jsonl +0 -0
  4. metadata.json +105 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bookmark Dataset
2
+
3
+ A collection of 11783 bookmarks from various sources including Twitter, GitHub, and Raindrop.io.
4
+
5
+ ## Dataset Description
6
+
7
+ This dataset contains bookmarks collected from various sources. Each record includes:
8
+
9
+ - Basic bookmark information (ID, title, URL, content)
10
+ - Source-specific metadata (Twitter metrics, GitHub repository info, etc.)
11
+ - Temporal information (creation date, year, month)
12
+ - Content analysis features (domain, content length)
13
+
14
+ ## Source Distribution
15
+
16
+ ```
17
+ source
18
+ raindrop 6147
19
+ twitter 2612
20
+ twitter_like 2105
21
+ github 919
22
+ ```
23
+
24
+ ## Top Domains
25
+
26
+ ```
27
+ domain
28
+ twitter.com 7625
29
+ github.com 1441
30
+ x.com 277
31
+ arxiv.org 158
32
+ chat.openai.com 53
33
+ huggingface.co 47
34
+ app.raindrop.io 33
35
+ colab.research.google.com 26
36
+ www.youtube.com 25
37
+ www.semanticscholar.org 20
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ This dataset can be used for:
43
+
44
+ - Analyzing bookmark patterns and trends
45
+ - Understanding content consumption across different platforms
46
+ - Training recommendation systems
47
+ - Studying information organization
48
+
49
+ ## Data Format
50
+
51
+ The dataset is provided in JSONL format with fields for common attributes and source-specific metadata.
52
+
53
+ Generated on: 2025-03-28
analyze_bookmarks.py ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import pandas as pd
3
+ import matplotlib.pyplot as plt
4
+ from pathlib import Path
5
+ import seaborn as sns
6
+
7
+ # Set style
8
+ plt.style.use('ggplot')
9
+ sns.set(style="whitegrid")
10
+
11
+ # Load the data
12
+ data_path = Path("data.jsonl")
13
+ bookmarks = []
14
+ with open(data_path, 'r', encoding='utf-8') as f:
15
+ for line in f:
16
+ bookmarks.append(json.loads(line))
17
+
18
+ # Convert to DataFrame
19
+ df = pd.DataFrame(bookmarks)
20
+
21
+ print(f"Loaded {len(df)} bookmarks")
22
+
23
+ # Basic statistics
24
+ print("\nSource Distribution:")
25
+ source_counts = df['source'].value_counts()
26
+ print(source_counts)
27
+
28
+ print("\nTop Domains:")
29
+ domain_counts = df['domain'].value_counts().head(20)
30
+ print(domain_counts)
31
+
32
+ # Create output directory for plots
33
+ plots_dir = Path("plots")
34
+ plots_dir.mkdir(exist_ok=True)
35
+
36
+ # Source distribution pie chart
37
+ plt.figure(figsize=(10, 7))
38
+ source_counts.plot.pie(autopct='%1.1f%%', textprops={'fontsize': 10})
39
+ plt.title('Bookmark Sources', fontsize=14)
40
+ plt.ylabel('')
41
+ plt.savefig(plots_dir / 'source_distribution.png', bbox_inches='tight')
42
+ plt.close()
43
+ print("Created source distribution chart: plots/source_distribution.png")
44
+
45
+ # Top domains bar chart
46
+ plt.figure(figsize=(12, 8))
47
+ domain_counts.head(15).plot.barh()
48
+ plt.title('Top 15 Domains', fontsize=14)
49
+ plt.xlabel('Count')
50
+ plt.ylabel('Domain')
51
+ plt.tight_layout()
52
+ plt.savefig(plots_dir / 'top_domains.png', bbox_inches='tight')
53
+ plt.close()
54
+ print("Created top domains chart: plots/top_domains.png")
55
+
56
+ # Bookmarks by month (if date data is available)
57
+ if 'created_at' in df.columns:
58
+ try:
59
+ # Convert to datetime if not already
60
+ if not pd.api.types.is_datetime64_any_dtype(df['created_at']):
61
+ df['created_at'] = pd.to_datetime(df['created_at'], errors='coerce')
62
+
63
+ # Extract year and month
64
+ df['year_month'] = df['created_at'].dt.to_period('M')
65
+
66
+ # Count bookmarks by month
67
+ monthly_counts = df.groupby('year_month').size()
68
+
69
+ plt.figure(figsize=(14, 8))
70
+ monthly_counts.plot.bar()
71
+ plt.title('Bookmarks by Month', fontsize=14)
72
+ plt.xlabel('Month')
73
+ plt.ylabel('Count')
74
+ plt.xticks(rotation=45)
75
+ plt.tight_layout()
76
+ plt.savefig(plots_dir / 'bookmarks_by_month.png', bbox_inches='tight')
77
+ plt.close()
78
+ print("Created bookmarks by month chart: plots/bookmarks_by_month.png")
79
+
80
+ # Bookmarks by source over time
81
+ source_time = pd.crosstab(df['year_month'], df['source'])
82
+
83
+ plt.figure(figsize=(14, 8))
84
+ source_time.plot.area(alpha=0.6)
85
+ plt.title('Bookmarks by Source Over Time', fontsize=14)
86
+ plt.xlabel('Month')
87
+ plt.ylabel('Count')
88
+ plt.legend(title='Source')
89
+ plt.tight_layout()
90
+ plt.savefig(plots_dir / 'sources_over_time.png', bbox_inches='tight')
91
+ plt.close()
92
+ print("Created sources over time chart: plots/sources_over_time.png")
93
+ except Exception as e:
94
+ print(f"Error creating time-based charts: {e}")
95
+
96
+ # Content length distribution
97
+ if 'content_length' in df.columns:
98
+ plt.figure(figsize=(12, 8))
99
+ sns.histplot(df['content_length'].clip(upper=5000), bins=50)
100
+ plt.title('Content Length Distribution (clipped at 5000 chars)', fontsize=14)
101
+ plt.xlabel('Content Length (characters)')
102
+ plt.ylabel('Count')
103
+ plt.tight_layout()
104
+ plt.savefig(plots_dir / 'content_length.png', bbox_inches='tight')
105
+ plt.close()
106
+ print("Created content length distribution: plots/content_length.png")
107
+
108
+ print("\nAnalysis complete. Check the 'plots' directory for visualizations.")
data.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
metadata.json ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_info": {
3
+ "description": "Bookmarks collected from various sources including Twitter, GitHub, and Raindrop.io",
4
+ "citation": "",
5
+ "homepage": "",
6
+ "license": "",
7
+ "features": {
8
+ "id": {
9
+ "dtype": "int64",
10
+ "description": "Unique identifier for the bookmark"
11
+ },
12
+ "source": {
13
+ "dtype": "string",
14
+ "description": "Source of the bookmark (twitter, github, raindrop, etc.)"
15
+ },
16
+ "title": {
17
+ "dtype": "string",
18
+ "description": "Title of the bookmark"
19
+ },
20
+ "url": {
21
+ "dtype": "string",
22
+ "description": "URL of the bookmark"
23
+ },
24
+ "content": {
25
+ "dtype": "string",
26
+ "description": "Content of the bookmark"
27
+ },
28
+ "created_at": {
29
+ "dtype": "string",
30
+ "description": "Creation date of the bookmark"
31
+ },
32
+ "domain": {
33
+ "dtype": "string",
34
+ "description": "Domain of the URL"
35
+ },
36
+ "content_length": {
37
+ "dtype": "int64",
38
+ "description": "Length of the content in characters"
39
+ },
40
+ "year": {
41
+ "dtype": "int64",
42
+ "description": "Year the bookmark was created"
43
+ },
44
+ "month": {
45
+ "dtype": "int64",
46
+ "description": "Month the bookmark was created"
47
+ },
48
+ "twitter_username": {
49
+ "dtype": "string",
50
+ "description": "Twitter username"
51
+ },
52
+ "twitter_name": {
53
+ "dtype": "string",
54
+ "description": "Twitter display name"
55
+ },
56
+ "twitter_followers": {
57
+ "dtype": "int64",
58
+ "description": "Number of Twitter followers"
59
+ },
60
+ "twitter_likes": {
61
+ "dtype": "int64",
62
+ "description": "Number of likes on the tweet"
63
+ },
64
+ "twitter_retweets": {
65
+ "dtype": "int64",
66
+ "description": "Number of retweets"
67
+ },
68
+ "twitter_replies": {
69
+ "dtype": "int64",
70
+ "description": "Number of replies to the tweet"
71
+ },
72
+ "github_repo": {
73
+ "dtype": "string",
74
+ "description": "GitHub repository name"
75
+ },
76
+ "github_stars": {
77
+ "dtype": "int64",
78
+ "description": "Number of stars on the GitHub repository"
79
+ },
80
+ "github_forks": {
81
+ "dtype": "int64",
82
+ "description": "Number of forks of the GitHub repository"
83
+ },
84
+ "github_owner": {
85
+ "dtype": "string",
86
+ "description": "Owner of the GitHub repository"
87
+ },
88
+ "github_language": {
89
+ "dtype": "string",
90
+ "description": "Primary language of the GitHub repository"
91
+ },
92
+ "raindrop_domain": {
93
+ "dtype": "string",
94
+ "description": "Domain saved in Raindrop.io"
95
+ },
96
+ "raindrop_tags": {
97
+ "dtype": "list",
98
+ "description": "Tags associated with the Raindrop bookmark",
99
+ "sequence": {
100
+ "dtype": "string"
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }