Package: tinq
Tinq.ai Python LibraryA Python wrapper for the Tinq.ai API - an easy-to-use text analysis and natural language processing toolkit.DocumentationFind the full API documentationhereRequirementsPython 3.7 or higherInstallationInstall the package with:pipinstalltinqUsageTable of ContentsAuthenticationRewriterSummarizerClassifierArticle ExtractorSentiment analysisPlagiarism CheckerPlease note that all methods return associative arrays. Responses can be found in the developer documentationhere.AuthenticationGet the API key for your project in Tinq.ai and then instantiate a new client.fromtinqimportTinqtinq=Tinq(api_key='<api-key>')Alternatively, set the API key and your username in an environment variable namedTINQ_API_KEY&TINQ_USERNAME, respectively.fromtinqimportTinqtinq=Tinq()RewriterRewrites/paraphrases a given text.textis the piece of content that you'd like to rewrite.
list of accepted parameters is availablehere.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)SummarizerSummarizes a given text.textis the piece of content that you'd like to summarize.
list of accepted parameters is availablehere.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)ClassifierClassifies a given text, according to a classifier that you specify$textis the piece of content that you'd like to summarize.$classifieris the piece of content that you'd like to summarize.$paramsis optional, a list of accepted parameters is availablehere.text="Hi, I need help with my website."classifier="fjew833"# ID of your classifier on Tinq.aiclassified=tinq.classify(text=text,classifier=classifier)Article ExtractorExtractor API is a feature-rich API and online application that handles all of the tedious work and problems associated with clean text extraction.urlURL from which you want to extract an article.
list of accepted parameters is availablehere.url="https://longreads.com/2021/08/19/bringing-species-back-from-the-brink/"extracted=tinq.extract_article(url=url)Sentiment AnalysisPerforms sentiment analysis operations for a given string.textis the piece of content that you'd like to summarize.
list of accepted parameters is availablehere.text="I really like you."sentimentAnalysis=tinq.sentiments(text=text)Plagiarism CheckerChecks for plagiarism and finds online sources for a given content.textis the piece of content that you'd like to summarize.
list of accepted parameters is availablehere.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)ContributingBug reports and pull requests are welcome on GitHub athttps://github.com/tinq-ai/tinq-python.LicenseThe package is available as open source under the terms of theMIT License.