# simple_text_analysis **Repository Path**: lengfeng001/simple_text_analysis ## Basic Information - **Project Name**: simple_text_analysis - **Description**: 编写一个包来使用python简化文本分析。这应该包括特征提取和构建预测模型。 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-05-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README The goal is to write a package to simplify text analysis with python. This should include both feature extraction and building predictive models. The package passes simple unit tests but requires additional testing. To use the package, you need data: Lists for outcomes and texts. To obtain a predictive bag-of-words model from the text, you write ```python from text_model import TextModel modules = "bag-of-words" text_model = TextModel(outcomes, texts, modules) ``` If you want to know the predicted value for new text, you write ```python text_model.predict("Some new text") ``` The package also contains additional feature extractors, for instance emotions (positive/negative and subjective/objective) and named entities (people and organizations). To extract these as well, you would write: ```python modules = ["bag-of-words", "emotions", "entities"] text_model = TextModel(outcomes, texts, modules) ``` The package does the text cleaning for you. But you can also change default options, for instance by setting: ```python options = {"lowercase": True, "lemmatize": True} text_model = TextModel(outcomes, texts, modules, options) ``` Simplifying the model this far does of course require making lots of assumptions along the way. If you want to, you should be able change these defaults one-by-one - this is not yet functional yet.