“Python Split String a las oraciones” Código de respuesta

Python dividió la oración en palabras

sentence = 'Hello world a b c'
split_sentence = sentence.split(' ')
print(split_sentence)
Stormy Seal

Python Split String a las oraciones

import spacy
nlp = spacy.load('en_core_web_sm') # Load the English Model

string1 = "This is the first sentence. This is the second sentence. This is the third sentence."
doc = nlp(string1)

list(doc.sents)
    
 # Output: ["This is the first sentence.", "This is the second sentence.", "This is the third sentence."]
Important Ibex

Párrafos divididos en Python

result = list(filter(lambda x : x != '', text.split('\n\n')))
Ugly Unicorn

Respuestas similares a “Python Split String a las oraciones”

Preguntas similares a “Python Split String a las oraciones”

Más respuestas relacionadas con “Python Split String a las oraciones” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código