The basic processing task of natural language is recorded as an example of function call in Spacy

Source: Internet
Author: User

#Coding=utf-8ImportSPACYNLP=spacy.load ('en_core_web_md-1.2.1') docx=NLP (U'The ways to process documents is so varied and application-and language-dependent that I decided to not constrain th EM by any interface.  Instead, a document is represented by the features extracted from it, not by its ' surface ' string form:how you get to the Features is up to you. Below I describe one common, general-purpose approach (called bag-of-words), but keep in mind that different application D Omains call for different features, and, as always, it's garbage in, garbage out ...')" "Functional Testing" "#1. Participle tokenizePrint '################ #tokenization' forTokeninchdocx:Printtoken#2. Pos tagging taggingPrint '################ #part of speech tagging' forTokeninchdocx:Print(token, token.pos_, Token.pos)#3. Named entity recognition Named entity recognitionPrint '################# Named Entity recognition' forEntinchdocx.ents:Print(Ent,ent.label_,ent.label)#4. Stemmers lemmatizePrint '################ #Lemmatize' forTokeninchdocx:Print(Token,token.lemma_,token.lemma)#5. Noun phrase extraction Noun Phrase ExtractionPrint '################ #Noun Phrase Extraction' forNpinchdocx.noun_chunks:PrintNP#6. Segmentation sentence SegmentationPrint '################ #Sentence Segmentation' forSentinchdocx.sents:PrintSent

The basic processing task of natural language is recorded as an example of function call in Spacy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.