Package: docusense
docusenseA python library for extracting main logic from document using NLP transformers and stop words.
With multilingual transformers the extraction process should work well enough on many types of documents.The purpose of this library is to extract main logical sense from documents without needing to open them.Featuressummary extractionquestions & answers from the documentstrongest keywords from documentSetupInstall using pippipinstalldocusenseTerminal usagesPossible parameterspath: document text for summarization.text: document text for summarization.lang: a language used for stopwords. Removes unnecessary stopwords for selected language.question: Question to look for the answer in text.min_length: Min length of generated summary.max_length: Max length of generated summary.max_answer_len: Max length of answer.n_keywords: Number of keywords to return.Simple caseLogging summary, answer to asked question and keywords.pythonextract.py--path"path/to/file"Examples as python codeSimple casefromdocusense.senseimportSenseExtractortext="""Good evening,Carriers constantly violate the passenger and baggage transport rules.In the evenings from 21:00 to 24:00 drivers are specially late to leavearound the ring for 3-4 minutes (all this time the buses are standing still in the ring with the engines running,at the same time creating additional air and noise pollution close to residential houses in the eveningsand during the night).Also, some buses often arrive a few minutes earlier than indicatedin the schedule. Apparently, the transporters live and work in a parallel world, somewhere at nighttraffic jams occur in the district.The company "Communication Services" has been informing about violations for several months, butdoes not take any action, although it is required to carry out the control of public transport carriers andensure compliance with passenger and baggage regulations.The director of the municipal administration also does not carry out any control, rules 3point - To instruct the Director of Administration to control how this is carried outsolution.Please provide an answer: why are the same violations repeated every night and howit is ensured that the carriers comply with the passenger and baggage transport rules."""extractor=SenseExtractor()output=extractor(text=text)Divided useYou can use each part of the extractor separate.Summarizertext="""Good evening,Carriers constantly violate the passenger and baggage transport rules.In the evenings from 21:00 to 24:00 drivers are specially late to leavearound the ring for 3-4 minutes (all this time the buses are standing still in the ring with the engines running,at the same time creating additional air and noise pollution close to residential houses in the eveningsand during the night).Also, some buses often arrive a few minutes earlier than indicatedin the schedule. Apparently, the transporters live and work in a parallel world, somewhere at nighttraffic jams occur in the district.The company "Communication Services" has been informing about violations for several months, butdoes not take any action, although it is required to carry out the control of public transport carriers andensure compliance with passenger and baggage regulations.The director of the municipal administration also does not carry out any control, rules 3point - To instruct the Director of Administration to control how this is carried outsolution.Please provide an answer: why are the same violations repeated every night and howit is ensured that the carriers comply with the passenger and baggage transport rules."""#summarizer partfromdocusense.summaryimportSummarizersummarizer=Summarizer()summary=summarizer(text,min_length=20)#questions and answersfromdocusense.qaimportQAExtractorqa_extractor=QAExtractor()answer=qa_extractor(text,question="What is the question in the text?")#keywordsfromdocusense.keywordsimportKeywordsExtractorkeywords_extractor=KeywordsExtractor()keywords=keywords_extractor(text,lang='english',n_keywords=3)DevelopmentInstall poetryhttps://python-poetry.org/docs/#installationdepending on your machinepoetry install