Skip to main content

TweetBench allows you to queue, run, and benchmark Tweet classification expirements with minimal configuration.

Project description

TweetBench

TweetBench allows you to queue, run, and benchmark Tweet classification expirements with minimal configuration. TweetBench imorts libraries and utilities, loads data, gathers expirements, executes pipeline on five different train/test splits, evaluates, averages, and compares scores to baseline, and generates a submission file for you. All you have to do is add and modify the pipelines in the ./expirements/ folder (Jupyter Notebook or Python scripts) with your parameters.

Prerequisites

  • Python 3
  • steuptools
  • wheel
  • virtualenv (optional)

Requirements (included in installation)

  • Jupyter Notebook
  • mapplotlib
  • pandas
  • scikit-learn

Installation

Clone this repository

git clone git@git.txstate.edu:CS7311/a-m730.git # or https://git.txstate.edu/CS7311/a-m730.git

cd a-m730/Project/source

It is recommended that you work in a virtual environment:

python -m virtualenv tweetbench_env && source tweetbench_env

Run installation:

python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps TweetBench-andrewmagill

Run Benchmark Pipeline

Start Jupyter Notebook:

jupyter notebook

Open and execute benchmark.ipynb to run the expirements contained in ./exprements/. To add a new expirement to the queue, simply add another Jupyter Notebook or python script to the ./expirements/ directory and re-run the notebook. Results will be displayed in the benchmark.ipynb Notebook, and written to the ./output/ directory.

Creating New Expriments

TweetBench will run pipelines found in any Jupyter Notebook or python script (.py file) in the expirements folder. There are some requirements, in order for an expirement to run, it must be written as a scikit-learn Pipeline (documentation and examples can be found here)

Example, the simplest possible pipeline, which should be run as the baseline for most of your expirements:

pipeline = Pipeline([('vectorizer', CountVectorizer()), ('classifier', LogisticRegression()))

You may also want to include metadata for your expirement. This is an optional step, but necessary if you want to designate a pipeline as your baseline for comparison. Your metadata variable must be named META and must be structured in the form of a Python dictionary and optionally contain the following fields: name:str, desription: str, baselinei: bool. Your pipeline's parameters will be inserted into the metadata, and output along with your expirement evaluation scores and predictions.

Example metadata:

META = {
"name": "fine-grained logreg text classifier",
"description": "Fine grained four classification: 5G Conspiracy, Other-Conspiracy, Non-conspiracy, Indeterminate",
"baseline": False
}

MediaEval 2020: FakeNews

The code used for the coarse and fine grained text classification, and classification augmented by OCR on Tweet images, as well as Lia Nogueria's community labels are included in the ./expirements/ folder.

Note: These expirements are run in the benchmark.ipynb notebook that imports libraries, loads data, gathers pipelines, and outputs results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TweetBench-andrewmagill-0.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TweetBench_andrewmagill-0.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file TweetBench-andrewmagill-0.0.2.tar.gz.

File metadata

  • Download URL: TweetBench-andrewmagill-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.4rc1

File hashes

Hashes for TweetBench-andrewmagill-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c72321ae4874fff8de840c7e11d8c96d2f606608a4306335b6c86216dba0a22f
MD5 6adfb1b6185433737180a7acd3101f95
BLAKE2b-256 993c643cbc4dd08046bbe24fbe63c353a6ce24a8a6f6bf3d07d8dc87d919aa23

See more details on using hashes here.

File details

Details for the file TweetBench_andrewmagill-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: TweetBench_andrewmagill-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.4rc1

File hashes

Hashes for TweetBench_andrewmagill-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c5c609dc77f001db54ddedfc600e50774f79d67f74e77b32e18cdc203bf8b65
MD5 f186deb442a5f5a189a2ac2dcb14018a
BLAKE2b-256 a79a0b55f4f2d3d22a4ef4296912777e07ca103d04f114de4d93b29841b64f54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page