Coder Social home page Coder Social logo

domvwt / news-signals-datasets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aylien/news-signals-datasets

0.0 0.0 0.0 2.1 MB

Creating time-indexed datasets with clusters of texts as inputs and timeseries as targets.

License: MIT License

Python 11.60% Makefile 0.12% HTML 24.75% Jupyter Notebook 63.51% Dockerfile 0.02%

news-signals-datasets's Introduction

News Signals

Example Colab Notebooks

These notebooks let you try out news-signals without installing anything!

The Colab notebooks above are also available as jupyter notebooks in research/news-signals-example-notebooks

2023-11-30: NEW: Create_Wikimedia_Signals.ipynb shows how to build and explore a WikimediaSignal which does not a NewsAPI account and works out-of-the-box for anyone.

Quickstart

Install news-signals in a new environment

conda create -n test-signals-pypi python=3.8
conda activate test-signals-pypi

pip install news-signals

Look at a sample dataset

Do pip install jupyter in your environment,

then run the code below in a jupyter notebook or in in the (i)python repl.

from news_signals.signals_dataset import SignalsDataset

# nasdaq100 sample dataset
dataset_url = 'https://drive.google.com/uc?id=150mfU2YA4ScfTlJvO6Duzto4aT_Q7K3D'

dataset = SignalsDataset.load(dataset_url)

Now try:

import matplotlib.pyplot as plt


fig = dataset.plot()
plt.show()

See the API Documentation for more info.

Installation from source

Install news-signals in a new environment

Run conda create -n news-signals python=3.8 if you're using Anaconda, alternatively python3.8 -m venv news-signals or similar. Note python>=3.8 is required.

source activate news-signals
git clone https://github.com/AYLIEN/news-signals-datasets.git
cd news-signals-datasets
pip install -r requirements.txt
pip install -e . # install in editable mode
make test   # run tests

Setting up Aylien NewsAPI credentials

The news-signals library looks for environment variables called 'NEWSAPI_APP_ID' and 'NEWSAPI_APP_KEY' - these are used to authenticate to the NewsAPI.

One way to set these variables up for local development is to Put your Aylien NewsAPI credentials in a file called ~/.aylienconfig .aylienconfig

app-id=<your-app-id>
app-key=<your-app-key>

Then put the following in your .bashrc or similar shell config file:

export NEWSAPI_APP_ID=$(cat ~/.aylienconfig | grep "app-id" | cut -d'=' -f2)
export NEWSAPI_APP_KEY=$(cat ~/.aylienconfig| grep "app-key" | cut -d'=' -f2)

Generating a new Dataset

Generate a new signals dataset as follows:

make create-dataset DATASET_CONFIG=resources/dataset-config-example.json

The config file specifies all relevant settings for a dataset, e.g. time range. Some examples that we used to create our provided example datasets:

A more detailed guide on generating new datasets is here: dataset-generation.md

Anomaly Classification Experiments

These currently live here.

news-signals-datasets's People

Contributors

chrishokamp avatar complementizer avatar aish-aylien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.