Saravanan666/pypi-org huggingface dataset:
Package: textboost
TextboostA bionic reading tool that leverages the power of machine learning to enhance the reading experience and organization, particularly for individuals with an inability to focus.How TextBoost Harnesses Machine LearningFolder Management: The model can create subsections such asmodified/food,modified/space,modified/politics, and more and store the respected pdf within their folder.Text Summarization: Textboost provides the capability to summarize the text within a given PDF. Optionally, the user can turn on this feature and the summarization will appear at the last page of the PDF.❗PLEASE NOTE THE FOLLOWING❗Please note that this tool supportssimple textextraction from PDFs. Complex elements like tables and code blocks will not be rendered properly.The updated PDF will be automatically placed in appropriate folders based on the text context. You can find your modified file in a folder similar to./modified/space/your_file.py.Don't forget to check your current directory for the outputted file.UsageInstallPython.Git clone this repository by running the commandhttps://github.com/boushrabettir/textboost.gitMove to thetextboostdirectory by runningcd ./textboostPip install requirements by runningpip install -r requirements.txtConvert your PDF to a Markdown usingthis tool.Place your modified Markdown file in thepre-modifiedfolder.Run the script by typingpython ./main.pyKey FeaturesBold formatting to emphasize specific letters within words.Organized file locations for modified files generated by a modelOptional text summarization generated by the modelDemohttps://github.com/boushrabettir/textboost/assets/116927138/f729e7f1-36aa-449d-b1a1-5f37d2026150Made with 🐱💛 by Boushra Bettir
Package: textbot
This python package prevalent trends from a large list of short statements.Operation:Read a column as an array of strings from csv file,Give them their pos-tag via the PENN treebankConvert to wordnet post-tags and keep only: ADJ / VERB / NOUN / ADVOption for user to save this lemmas-array back to csv fileEnumerate most_common lemmasWeight each string in the array according to the most-common lemmas it containsOption for user to save this weight-array back to the csv file
Package: text-box-wrapper
Text Box WrapperA simple Python package to wrap text with ASCII art or other characters. It also supports custom alignment (left, center, or right) and can be used as a decorator.InstallationInstall the package using pip:pipinstalltext-box-wrapperUsageBasic usageImport thewrap_with_ascii_artfunction and use it to wrap your text:fromtext_box_wrapperimportwrap_with_ascii_arttext="Hello, World!"wrapped_text=wrap_with_ascii_art(text)print(wrapped_text)Example output:###########################################
###########################################
#####                                 #####
#####                                 #####
#####          Hello, World!          #####
#####                                 #####
#####                                 #####
###########################################
###########################################Customizing the wrapperYou can customize the padding, border string,
and alignment:from text_box_wrapper import wrap_with_ascii_art

text = "你好，成都"
border_string = "#"
wrapped_text = wrap_with_ascii_art(text, min_padding=5, vertical_padding=2, border_string=border_string, alignment="center")
print(wrapped_text)Example output:######################
#                    #
#                    #
#     你好，成都       #
#                    #
#                    #
######################Using the decoratorYou can also use thewrapdecorator to automatically wrap the output of a function:fromtext_box_wrapperimportwrap@wrap(min_padding=7,vertical_padding=1,border_string="*",alignment="center")defgreet(name):returnf"Hello,{name}!"print(greet("John"))Example output:****************************
*                          *
*       Hello, John!       *
*                          *
****************************ContributingFeel free to submit issues or pull requests if you have any suggestions, improvements, or bug reports.LicenseThis project is licensed under theMIT License.
Package: text-bridge
TextBridgeThis is a package that is an abstraction layer over large language models. It contains functions that wrap requests to large language model API (e.g. OpenAI API) endpoints with useful functionality.Specifically, there are few main concepts that this package is introducing:
a) The prompts are stored in Jinja2 templates. When the user of the package callscompleteorchat_complete, they pass the name of the template as argument. Those templates are stored in some folder.
b) Each prompt has a config - it stores the parameters used with that prompt (likemax_tokensormodel).
c)embeddingsmodule contains some useful functions for search based on embeddings from OpenAI API.
Package: textbsr
Update v0.1.12Support text region with different angle.Higher resolution. min(height, width) of output is 256 (128 in v0.24.0)See our project page for more details:https://github.com/csxmli2016/textbsrThis is a simple text image super-resolution package.More details can be found in our Project Page:https://github.com/csxmli2016/textbsrThis package can post-process the text region with a simple command, i.e.,textbsr -i [LR_TEXT_PATH] -b [BACKGROUND_SR_PATH][LR_TEXT_PATH] is the LR image path.[BACKGROUND_SR_PATH] stores the results from any blind image super-resolution methods.If the text image is degraded severely, this method may still fail to obtain a plausible result.Dependencies and Installationnumpycnstdtorch>=1.8.1torchvision>=0.9# Install with pip
pip install textbsrBasic Usage# On the terminal command
textbsr -i [LR_TEXT_PATH]or# On the python environment
from textbsr import textbsr
textbsr.bsr(input_path='./testsets/LQs')Parameter details:parameter namedefaultdescription-i, --input_path-The lr text image path. It can store full images or text layouts only.-b, --bg_pathNoneThe background sr path from other methods. If None, we only restore the text region detected by cnstd.-o, --output_pathNoneThe save path for text sr result. If None, we save the results on the same path with the format of [input_path]_TIMESTAMP.-a, --alignedFalseaction='store_true'. If True, the input text image contains only text region. If False, we use CnSTD to detect text regions and then restore them.-s, --save_textFalseaction='store_true'. If True, save the LR and SR text layout.-d, --deviceNoneDevice, use 'gpu' or 'cpu'. If None, we use torch.cuda.is_available to select the device.Example for post-processing the text region# On the terminal command
textbsr -i [LR_TEXT_PATH] -b [BACKGROUND_SR_PATH] -sor# On the python environment
from textbsr import textbsr
textbsr.bsr(input_path='./testsets/LQs', bg_path='./testsets/RealESRGANResults', save_text=True)When [BACKGROUND_SR_PATH] is None, we only restore the text region and paste it back to the LR input, with the background region unchanged.Example for restoring the aligned text region# On the terminal command
textbsr -i [LR_TEXT_PATH] -aor# On the python environment
from textbsr import textbsr
textbsr.bsr(input_path='./testsets/LQs', aligned=True)If you find this package helpful, please kindly consider citing our paper:@InProceedings{li2023marconet,
author = {Li, Xiaoming and Zuo, Wangmeng and Loy, Chen Change},
title = {Learning Generative Structure Prior for Blind Text Image Super-resolution},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year = {2023}
}
Package: textbytesencoder
TextBytesEncoderModule encoding and encrypting text by keyUsage examplefromtextbytesencoderimportEncoderencoder=Encoder(key=None,save_key=False)# key: Optional[bytes] = None, save_key: Optional[bool] = Falseprint(encoder.encrypt(text))# type(text) == strprint(encoder.decrypt(text))# type(text) == bytesDuring initialization, you can specify the optionalkeyparameter (key, type and purpose see below) and the optionalsave_keyparameter (saves the key to a separate file)ParametersParameterkeyof type bytes, generated using theFernet.generate_key()function
or using thebase64.urlsafe_b64encode(os.urandom(32))function used to encode or decode text.print(encoder.key)encoder.key=b"key"# key = Fernet.generate_key() or base64.urlsafe_b64encode(os.urandom(32))
Package: textcaptcha
TextCaptchaA Python library for using text-based CAPTCHAs fromhttp://textcaptcha.com/.This is a simple wrapper around theTextCaptchaAPI which is a service which provides text-based CAPTCHA questions which helps to prevent spam from robots.This is designed to be implemented into a server-side application such as a Discord Bot, IRC, SMS, etc...Note:The TextCaptcha API is only suitable for low traffic websites. For more than 5 requests per second, your usage will be rate limited.InstallationUsepipto install on all systems:pipinstalltextcaptchaUsage ExampleThis example will ask a CAPTCHA question and ask for an answer which is then checked against the actual answer.importtextcaptcha# Create a captcha fetcher to fetch captcha questions from the APIfetcher=textcaptcha.CaptchaFetcher()# Fetch a new captcha from the APIcaptcha=fetcher.fetch()# Print the captcha question to the consoleprint(captcha.question)# Get a response from the useranswer=input("Answer: ")# Check that the answer is correctifcaptcha.check_answer(answer):print("You're not a robot!")else:print("You are a robot, sorry!")Development SetupThis project uses Poetry to manage dependencies and packaging.Hereare the installation instructions for Poetry.ContributingFork it (https://github.com/jake-walker/pytextcaptcha/fork)Create your feature branch (git checkout -b feature/foobar)Commit your changes (git commit -am "Add some foobar")Push to the branch (git push origin feature/foobar)Create a new pull request
Package: textcaret
textcaretSimplified NLP Toolkit for common NLP Tasks. Unifying common Natural Language Processing taskWhy TextCaretThe problem: performing common NLP Task such as summarization,sentiment analysis,etc are essential however you may need to use different libraries and write different codes for performing the same set of task on different textsThe goal of TextCaret is to simplify this task by providing a unified framework to
perform these common NLP TasksInstallationtextcaret is available on pypi hence you can install using pippipinstalltextcaretBenefits and FeaturesGenerate Reports for Text AnalysisText SummarizationText Visualizationwordcloudword frequency plotsword length distributionetcSentiment AnalysisText Generation *etcUsage>>>importtextcaretastc>>>docx=tc.TextCaret(text='your text goes here')>>>>>>docx.visual_report()>>>docx.summary_report()>>>docx.sentiment_report()>>>docx.general_report()Perform Text Visualization For InsightsThis generates wordcloud plots,token and tags frequency plots, word length distribution and more.>>>fromtextcaretimportTextViz>>>s="your text">>>viz=TextViz(s)>>>viz.visualize()>>># Save Plot>>>viz.safe_figure('mynewplot.png')Perform TextSummarizationIn NLP Text Summarization is the process of shortening a set of data computationally, to create a subset (a summary) that represents the most important or relevant information within the original content.[wiki]It is the process of finding the most informative sentence in a document.TextCaret uses several extractive algorithms for generating summary>>>fromtextcaretimportTextSummarizer>>>s="your text">>>summarizer=TextSummarizer(s)>>>summarizer.summarize()Perform Sentiment AnalysisIn NLP, Sentiment Analysis is the process of identifying the emotions/sentiment or feeling in a given text either as positive,negative or neutral.It is a form of text classificationTextCaret uses the famous textblob library behind the scene to generate sentiments of given text>>>fromtextcaretimportTextSentiment>>>docx=TextSentiment("I love coding and teaching.John hates mangoes so bad he doesn't eat it")>>>>>>docx.sentiment(){'sentence':"I love coding and teaching.John hates mangoes so bad he doesn't eat it",'sentiment':Sentiment(polarity=-0.09999999999999992,subjectivity=0.6333333333333333)}>>>>>>docx.sentiment()['sentiment']Sentiment(polarity=-0.09999999999999992,subjectivity=0.6333333333333333)>>>>>>docx.sentiment()['sentiment'].polarity-0.09999999999999992>>>>>>docx.sentiment()['sentiment'].subjectivity0.6333333333333333>>>Perform Sentiment on Splitted/Tokenized Sentences>>>docx.split_sentence=True>>>>>>docx.sentiment(){'sentiment':[('I love coding and teaching',0.5),("John hates mangoes so bad he doesn't eat it",-0.6999999999999998)]}>>>DependenciesTextcaret is built ontop of powerful and common NLP libraries such as belowNLTKTextBlobSumyNeattextMatplotlibWordcloudSpacy.Maintainer: Jesse E.Agbe(JCharis)Jesus Saves @JCharisTechContributionsNotice a bug, please let us knowWe appreciate contributions of anykind.Happy Coding!!! :smiley:
Package: textcheck
textcheckRun text checks on files from the command line.┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Word    ┃ Alternatives                                    ┃ Context                       ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ speling │ spieling, spelling, spewing, peeling, splinting │ should be checked for speling │
└─────────┴─────────────────────────────────────────────────┴───────────────────────────────┘Installationpip install --user textcheckHunspell dictionary filesen_US.dicanden_US.affneed to be placed in/usr/share/hunspelldirectory.LimitationsOnly console output for now.Only English language is supported.Only Linux-based systems are supported.CLI usagespellcheckExample invocation:textcheck spellcheck ~/spellme.txt --ignore-list=/home/user/ignore_list.txtRun spellcheck for a set of files.Provided ignore list is a file with ignore words on new lines.Usage:$textcheckspellcheck[OPTIONS]FILES...Arguments:FILES...: The list of files to checkOptionsignore_list: Path to the ignore list file.
Package: text-chunker
TextChunkerTextChunker is a Python class that takes in long text as input and divides it into shorter chunks no longer than a specified length. The purpose of this project is to provide a simple and useful tool for data processing tasks such as natural language processing and information extraction.Installpipintslltext_chunkerUsageYou can use theTextChunkerclass in your Python code as follows:fromtext_chunkerimportTextChunker# Create a new TextChunker object with a maximum chunk length of 50 characterschunker=TextChunker(maxlen=1000)# Chunk a long text string into smaller chunkstext="This is a long text string..."forchunkinchunker.chunk(text):print(chunk)Thechunkmethod attempts to split paragraphs first while keeping chunk length belowmaxlen. If a paragraph is longer thanmaxlen, the method attempts to split the paragraph into sentences. If a sentence is longer thanmaxlen, it is split into smaller chunks no longer thanmaxlen.There are also functions calledparagraphsandsentencesthat divide the text into paragraphs and sentences, respectively.fromtext_chunkerimportparagraphsforpinparagraphs(text):print(p)fromtext_chunkerimportsentencesforsinsentences(text):print(s)Thesentencesfunction utilizes a tokenizer from thenltklibrary.LicenseThis project is distributed under the MIT license. See the LICENSE file for details.
Package: textcl
TextCLIntroductionTheTextCLpackage aims to clean text data for later use in Natural Language Processing tasks. It can be used as an initial step in text analysis as well as in predictive, classification or text generation models.The quality of the models strongly depends on the quality of the input data. Common problems in the data sets include:If data are coming from a optical character recognition (OCR) platform, text in tables and columns is usually not processed correctly and will add noise to the models.Some parts of large texts scopes may contain sentences from different languages rather than the target language of the model and have to be filtered out.Real-world texts often have duplicated sentences due to the use of templates. In text generation tasks, this can cause model overfitting and duplications in generated texts or summaries.Data sets may contain text that is different from the main topic, such as a weather forecast in an accounting report.FeaturesTheTextCLpackage allows the user to perform the following text pre-processing tasks:Split texts into sentences.Language filtering, for removing sentences from text not in the target language.Perplexity filtering, for removing linguistically unconnected sentences, that can be produced by OCR modules. For example:Sustainability Report 2019 36 3%?!353? 1. 5В°C 1} 33%.Duplicate sentences filtering using Jaccard similarity, for removing duplicate sentences from the text.Unsupervised outlier detection for revealing texts that are outside of the main data set topic distribution. Four methods are included with package for this purpose:TONMF: Block Coordinate Descent Framework
(source article,matlab implementation)RPCA: Robust Principal Component Analysis
(source article,python implementation)SVD: Singular Value Decomposition
(based on theNumPy SVD implementation)DocumentationTextCL's API documentationTutorial for the preprocessing functionsDeveloper's guideRequirementsPython >= 3.6pytorch_pretrained_bert >= 0.6.2langdetect >= 1.0.8numpy >= 1.16.5, < 1.20.0pandas >= 1.0.3lxml >= 4.6.2protobuf >= 3.14.0nltk >= 3.4.5How to installFrom PyPIpip install textclFrom source/GitHubpip install git+https://github.com/alinapetukhova/textcl.git#egg=textclLicenseMIT License
Package: text-classify
# TextClassify## Model* fastText char* fastText word* CNN char embedding* CNN word embedding* CNN char & word embedding* CNN + BiGRU + char & word embedding## Segment Model* pyltp* jieba## Embedding* fastText (CBOW / skip-gram)* gensimchar or word embedding## Usage```pythonfrom text_classify import TextClassify# default paramst = TextClassify()text = ''logtis = t.predict(text, precision='16')# get index2labelt.index2label# get top labelt.get_top_label(text, k=5, precision='16')```## Parameters### `TextClassify`* model: 'fasttext' (default), 'cnn', 'mcnn', 'mgcnn'* cut: True, False (default)* cut_model: 'pyltp' (default), 'jieba'* pyltp_model: '/data_hdd/ltp_data/cws.model'* fasttext_char_model: '/data_hdd/embedding/fasttext/zhihu_char_model.bin'* fasttext_word_model: '/data_hdd/embedding/fasttext/zhihu_word_model.bin'* cnn_char_model: '/home/keming/GitHub/custom_recom/cnn_char_fulltext_best.pth'* cnn_word_model: '/home/keming/GitHub/custom_recom/cnn_word_fulltext_best.pth'* mcnn_model: '/home/keming/GitHub/custom_recom/mcnn_fulltext_best.pth'* mgcnn_model: '/home/keming/GitHub/custom_recom/mgcnn_fulltext_best.pth'* char_embedding_model: '/data_hdd/embedding/wiki_char_256.model'* word_embedding_model: '/data_hdd/embedding/wiki_word_256.model'* words_index: '/data_hdd/zhihu/topic/words.csv'* chars_index: '/data_hdd/zhihu/topic/chars.csv'* labels_index: '/data_hdd/zhihu/topic/topics.csv'* delete_char: '/data_hdd/zhihu/del_chars.txt'* num_class: 384* embedding_dim: 256* num_filter: 128* char_sentence_length: 256* word_sentence_length: 128* char_vocab_size: 12592* word_vocab_size: 727811* filter_size_1: [2, 3, 4, 5]* filter_size_2: [2, 3, 4]* rnn_num_unit: 128* rnn_num_layer: 2### `TextClassify.predict`* text* precision: '16' (default), '32', '64'### `TextClassify.get_top_label`* text* k: 5 (default), numbers of label to return* precision: '16' (default), '32', '64'
Package: text-clean
#text-clean
Process text for NLP.how to usefromtext_cleanimportTextCleantc=TextClean()_str="繁 體 字是smasd ❶ ❷ ❸ ❹ 艹艹艹艹 艹艹艹艹nm 夶彩呗我 幹什麼 □ ■ ◇ ◆ − ++++++++ ⑪ ⑫ ⑬  ⒍ ⒎ ⒏ ⒐ W,X  asd鬼东 西錯 鍼٩(๑ᵒ̴̶͈᷄ᗨᵒ̴̶͈᷅)و q🕓🕛"print(tc.clean(_str))# output# 繁体字是smasd1234艹艹艹nm大大彩呗我干什么+++1112136789wxasd鬼东西错针q
Package: textcleaner
textcleaner v0.4.26Text-Cleaner is a utility library for text-data pre-processing. Use it
before passing the text data to a model.website- for moreFeatures!main_cleaner to do all the below in one call ! orremove unnecessary blank linesstip out a perticular character or default onetransfer all characters to lowercase if neededremove numbers, symblos and stop-words from the whole texttokenize the text-data on one callstemming & lemmatization powered by NLTKThe goal is to make basic cleaning of data hassle free. Most of the
developers who are working with text data have faced this situation
where data is not consumable and they end up wasting their time on
these issues rather than fine tunning the model and get better
accuracy. In that scenario this library can be useful and save you a
tone of time.Techtextcleaner uses a number of open source projects to work properly:NLTK- for advanced cleaningREGEX- for regular expressionAnd of course textcleaner itself is open source with apublic
repositoryon GitHub.Installationtextcleaner requiresPython 3.xto run.Install the dependencies if you have not already installed it!NLTK : steps to install
[documentation]REGEX :pipinstallregextextcleaner :pipinstalltextcleanerorpipinstalltextcleaner==0.4.26Usageimporttextcleanerastctc.main_cleaner('<FILE_NAME>')#ortc.document('<FILE_NAME>')Above command will convert the text file into list of words with
cleaning. Default response of the function is list of list useopargument and set it to ‘words’ and you will get a flat list of words.Todosmore advanced featuresability to read more formats rather than only .txtLicenseMITFree Software, Hell Yeah!
Package: textcloud
LinuxmacOSWindowsPyPItext_cloudA little text cloud generator in Python, that generates a cloud of sentences from a list of sentences given as ain input. This is based on the nifty package from AMueller's, the wordcloud. Read more about the wordcloud package on the [blog
post][blog-post] or the [website][website].The code is tested against Python 2.7, 3.4, 3.5, 3.6 and 3.7.InstallationIf you are using pip:pip install textcloudInstallation notestextcloud depends onnumpyandpillow.To save the textcloud into a file,matplotlibcan also be installed. Seeexamplesbelow.If there are no wheels available for your version of python, installing the
package requires having a C compiler set up. Before installing a compiler, report
an issue describing the version of python and operating system being used.ExamplesCheck out [examples/simple.py][simple] for a short intro. A sample output is:Or run [examples/masked.py][masked] to see more options. A sample output is:Getting fancy with some colors:Generating wordclouds for Arabic:LicensingThe textcloud library is MIT licenced, but contains DroidSansMono.ttf, a true type font by Google, that is apache licensed.
The font is by no means integral, and any other font can be used by setting thefont_pathvariable when creating aTextCloudobject.