Skip to main content

Python 3 API to the TweeboParser

Project description

Tweebo Parser Python API

This is a Python 3 API to the TweeboParser using the TweeboParser API server which is servered using the Docker image which can be found here.

Installation and setup

  1. Requires Python 3.6
  2. pip install tweebo-parser-python-api
  3. Install docker
  4. Start the TweeboParser API server running locally on port 8000: docker run -p -d --rm 8000:8000 mooreap/tweeboparserdocker

NOTE This will run the server using as many threads as you have CPU cores on your machine. If you would like to specify the number of threads use the --threads flag e.g.:

docker run -p -d --rm 8000:8000 mooreap/tweeboparserdocker --threads 4

Also to stop the docker server running:

  1. Find the name assigned to the docker image using: docker ps
  2. Then stop the relevant docker image: docker stop name_of_image

Example

from tweebo_parser import API, ServerError
# Assumes server is running locally at 0.0.0.0:8000
tweebo_api = API()
text_data = ['Guangdong University of Foreign Studies is located in Guangzhou.',
             'Lucy is in the sky with diamonds.']
try:
    result_stanford = tweebo_api.parse_stanford(text_data)
    result_conll = tweebo_api.parse_conll(text_data)
except ServerError as e:
    print(f'{e}\n{e.message}')

For a more detailed example see the following jupyter notebook

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

tweebo_parser_python_api-1.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

tweebo_parser_python_api-1.0.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

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