A Python wrapper for the Tinq.ai API - an easy-to-use text analysis and natural language processing toolkit.
Project description
Tinq.ai Python Library
A Python wrapper for the Tinq.ai API - an easy-to-use text analysis and natural language processing toolkit.
Documentation
Find the full API documentation here
Requirements
Python 3.7 or higher
Installation
Install the package with:
pip install tinq
Usage
Table of Contents
- Authentication
- Rewriter
- Summarizer
- Classifier
- Article Extractor
- Sentiment analysis
- Plagiarism Checker
Please note that all methods return associative arrays. Responses can be found in the developer documentation here.
Authentication
Get the API key for your project in Tinq.ai and then instantiate a new client.
from tinq import Tinq
tinq = Tinq(api_key='<api-key>')
Alternatively, set the API key and your username in an environment variable named TINQ_API_KEY & TINQ_USERNAME, respectively.
from tinq import Tinq
tinq = Tinq()
Rewriter
Rewrites/paraphrases a given text.
text is the piece of content that you'd like to rewrite.
list of accepted parameters is available here.
text = "The process of learning a new piece of music is fantastic. You start from nothing, practise, improve, and finally get the fruits of your hard work, as farmers do during the harvest time."
rewritten = tinq.rewrite(text)
Summarizer
Summarizes a given text.
text is the piece of content that you'd like to summarize.
list of accepted parameters is available here.
text = "Bernal’s case study is Tullis Mason, a chap who sports “three-quarter length shorts” even in a lab coat. Matson runs an artificial insemination company for racehorses from his family’s farm in Shropshire, England. However, on the side, he is also planning to save the animal kingdom by building the biggest biobank of animal cells in Europe. It’s not always a dignified business, with Bernal describing Mason hooking an elephant penis into a device that looks like “a huge condom,” but the science and the ethics her article explores are fascinating. We may not be about to bring dinosaurs back to life, but with help from biobanking, life already on this planet might still find a way."
summary = tinq.summarize(text)
Classifier
Classifies a given text, according to a classifier that you specify
$text is the piece of content that you'd like to summarize.
$classifier is the piece of content that you'd like to summarize.
$params is optional, a list of accepted parameters is available here.
text = "Hi, I need help with my website."
classifier = "fjew833" # ID of your classifier on Tinq.ai
classified = tinq.classify(text=text, classifier=classifier)
Article Extractor
Extractor API is a feature-rich API and online application that handles all of the tedious work and problems associated with clean text extraction.
url URL from which you want to extract an article.
list of accepted parameters is available here.
url = "https://longreads.com/2021/08/19/bringing-species-back-from-the-brink/"
extracted = tinq.extract_article(url=url)
Sentiment Analysis
Performs sentiment analysis operations for a given string.
text is the piece of content that you'd like to summarize.
list of accepted parameters is available here.
text = "I really like you."
sentimentAnalysis = tinq.sentiments(text=text)
Plagiarism Checker
Checks for plagiarism and finds online sources for a given content.
text is the piece of content that you'd like to summarize.
list of accepted parameters is available here.
text = "Bernal’s case study is Tullis Mason, a chap who sports “three-quarter length shorts” even in a lab coat. Matson runs an artificial insemination company for racehorses from his family’s farm in Shropshire, England."
checkPlagiarism = tinq.check_plagiarism(text=text)
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/tinq-ai/tinq-python.
License
The package is available as open source under the terms of the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tinq-0.0.2.tar.gz.
File metadata
- Download URL: tinq-0.0.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bb763059012f29db4af8fec3ea04d5d3d5ff62f003240c029d7c72934c97008
|
|
| MD5 |
62cda78821dbecbf248c9c46613bd5dd
|
|
| BLAKE2b-256 |
b696d8d30a5be3d5cfd1833b94f404da8e4f369af5e1ae94655e67d4e1c37f4f
|
File details
Details for the file tinq-0.0.2-py3-none-any.whl.
File metadata
- Download URL: tinq-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86d5e549ae947007941970fbba3d675306f7f8b719829e8d6b22002adada9e70
|
|
| MD5 |
e6593eeb541124972515f0259baff962
|
|
| BLAKE2b-256 |
079b0a56e705efb7de65eabdce54165208c0af91912f108ac77b0bf9723662bd
|