Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
Fixed reddit example (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
miratepuffin authored Apr 5, 2023
1 parent 56570e1 commit 2c06a16
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 91 deletions.
12 changes: 6 additions & 6 deletions docbrown/db/src/graph_loader/reddit_hyperlinks.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Load (a subset of) Reddit hyperlinks dataset into a graph.
//! The dataset is available at https://snap.stanford.edu/data/soc-redditHyperlinks-body.tsv
//! The dataset is available at http://snap.stanford.edu/data/soc-redditHyperlinks-title.tsv
//! The hyperlink network represents the directed connections between two subreddits (a subreddit
//! is a community on Reddit). We also provide subreddit embeddings. The network is extracted
//! from publicly available Reddit data of 2.5 years from Jan 2014 to April 2017.
Expand Down Expand Up @@ -55,8 +55,8 @@ use std::path::PathBuf;
/// * `PathBuf` - The path to the file
pub fn reddit_file(timeout: u64) -> Result<PathBuf, Box<dyn std::error::Error>> {
fetch_file(
"reddit.tsv",
"https://snap.stanford.edu/data/soc-redditHyperlinks-body.tsv",
"reddit-title.tsv",
"http://snap.stanford.edu/data/soc-redditHyperlinks-title.tsv",
timeout,
)
}
Expand Down Expand Up @@ -111,15 +111,15 @@ pub fn reddit_graph(shards: usize, timeout: u64) -> Graph {
("readability".to_string(), Prop::F64(post_properties[17])),
(
"positive_sentiment".to_string(),
Prop::F64(post_properties[17]),
Prop::F64(post_properties[18]),
),
(
"negative_sentiment".to_string(),
Prop::F64(post_properties[17]),
Prop::F64(post_properties[19]),
),
(
"compound_sentiment".to_string(),
Prop::F64(post_properties[17]),
Prop::F64(post_properties[20]),
),
];
g.add_vertex(time, *src_id, &vec![])
Expand Down
383 changes: 383 additions & 0 deletions python/tests/demo.ipynb

Large diffs are not rendered by default.

85 changes: 0 additions & 85 deletions python/tests/reddit_example.ipynb

This file was deleted.

0 comments on commit 2c06a16

Please sign in to comment.