text-segmentation

Split text into sentences [duplicate]

南楼画角 提交于 2019-12-07 06:44:57
问题 This question already has answers here : Python split text on sentences (10 answers) Closed 9 months ago . I wish to split text into sentences. Can anyone help me? I also need to handle abbreviations. However my plan is to replace these at an earlier stage. Mr. -> Mister import re import unittest class Sentences: def __init__(self,text): self.sentences = tuple(re.split("[.!?]\s", text)) class TestSentences(unittest.TestCase): def testFullStop(self): self.assertEquals(Sentences("X. X.")

Word segmentation using dynamic programming

孤人 提交于 2019-12-07 02:51:58
问题 So first off I'm very new to Python so if I'm doing something awful I'm prefacing this post with a sorry. I've been assigned this problem: We want to devise a dynamic programming solution to the following problem: there is a string of characters which might have been a sequence of words with all the spaces removed, and we want to find a way, if any, in which to insert spaces that separate valid English words. For example, theyouthevent could be from “the you the vent”, “the youth event” or

English word segmentation in NLP?

旧城冷巷雨未停 提交于 2019-12-06 08:58:15
问题 I am new in the NLP domain, but my current research needs some text parsing (or called keyword extraction) from URL addresses, e.g. a fake URL, http://ads.goole.com/appid/heads Two constraints are put on my parsing, The first "ads" and last "heads" should be distinct because "ads" in the "heads" means more suffix rather than an advertisement. The "appid" can be parsed into two parts; that is 'app' and 'id', both taking semantic meanings on the Internet. I have tried the Stanford NLP toolkit

extract a sentence using python

ⅰ亾dé卋堺 提交于 2019-12-06 01:42:27
I would like to extract the exact sentence if a particular word is present in that sentence. Could anyone let me know how to do it with python. I used concordance() but it only prints lines where the word matches. Just a quick reminder: Sentence breaking is actually a pretty complex thing, there's exceptions to the period rule, such as "Mr." or "Dr." There's also a variety of sentence ending punctuation marks. But there's also exceptions to the exception (if the next word is Capitalized and is not a proper noun, then Dr. can end a sentence, for example). If you're interested in this (it's a

Independent clause boundary disambiguation, and independent clause segmentation – any tools to do this?

旧街凉风 提交于 2019-12-06 01:14:24
问题 I remember skimming the sentence segmentation section from the NLTK site a long time ago. I use a crude text replacement of “period” “space” with “period” “manual line break” to achieve sentence segmentation, such as with a Microsoft Word replacement ( . -> .^p ) or a Chrome extension: https://github.com/AhmadHassanAwan/Sentence-Segmentation https://chrome.google.com/webstore/detail/sentence-segmenter/jfbhkblbhhigbgdnijncccdndhbflcha This is instead of an NLP method like the Punkt tokenizer

How to remove OCR artifacts from text?

本秂侑毒 提交于 2019-12-05 13:32:24
OCR generated texts sometimes come with artifacts, such as this one: Diese grundsätzliche V e r b o r g e n h e i t Gottes, die sich n u r dem N a c h f o l g e r ö f f n e t , ist m i t d e m Messiasgeheimnis gemeint While it is not unusual, that the spacing between letters is used as emphasis (probably due to early printing press limitations), it is unfavorable for retrieval tasks. How can one turn the above text into a more, say, canonical form, like: Diese grundsätzliche Verborgenheit Gottes, die sich nur dem Nachfolger öffnet, ist mit dem Messiasgeheimnis gemeint Can this be done

Split text into sentences [duplicate]

依然范特西╮ 提交于 2019-12-05 10:18:42
This question already has answers here : Python split text on sentences (10 answers) Closed 9 months ago . I wish to split text into sentences. Can anyone help me? I also need to handle abbreviations. However my plan is to replace these at an earlier stage. Mr. -> Mister import re import unittest class Sentences: def __init__(self,text): self.sentences = tuple(re.split("[.!?]\s", text)) class TestSentences(unittest.TestCase): def testFullStop(self): self.assertEquals(Sentences("X. X.").sentences, ("X.","X.")) def testQuestion(self): self.assertEquals(Sentences("X? X?").sentences, ("X?","X?"))

Anyone know an example algorithm for word segmentation using dynamic programming? [closed]

随声附和 提交于 2019-12-04 15:24:40
If you search google for word segmentation there really are no very good descriptions of it and I'm just trying to fully understand the process a dynamic programming algorithm takes to find a segmentation of a string into individual words. Does anyone know a place where there is a good description of a word segmentation problem or can anyone describe it? Word Segmentation is basically just taking a string of characters and deciding where to split it up into words if you didn't know and using dynamic programming it would take into account some amount of subproblems. This is pretty simple to do

English word segmentation in NLP?

久未见 提交于 2019-12-04 12:59:06
I am new in the NLP domain, but my current research needs some text parsing (or called keyword extraction) from URL addresses, e.g. a fake URL, http://ads.goole.com/appid/heads Two constraints are put on my parsing, The first "ads" and last "heads" should be distinct because "ads" in the "heads" means more suffix rather than an advertisement. The "appid" can be parsed into two parts; that is 'app' and 'id', both taking semantic meanings on the Internet. I have tried the Stanford NLP toolkit and Google search engine. The former tries to classify each word in a grammar meaning which is under my

Sentence segmentation tools to use when input sentence has no punctuation (is normalized)

核能气质少年 提交于 2019-12-04 10:15:31
Suppose there is a sentence like "find me some jazz music and play it", where all the text is normalized and there are no punctuation marks (output of a speech recognition library). What online/offline tools can be used to do "sentence segmentation" other than the naive approach of splitting on conjunctions ? Input: find me some jazz music and play it Output: find me some jazz music play it A dependence parser should help. You can use a semantic role tagger like mate tools etc... for this. It will extract the predicates and the related arguments in prop bank style. 来源: https://stackoverflow