Skip to content

Instantly share code, notes, and snippets.

@skwolvie
Created July 18, 2021 20:58
Show Gist options
  • Save skwolvie/e7280d3a6739851c78f685dce0591013 to your computer and use it in GitHub Desktop.
Save skwolvie/e7280d3a6739851c78f685dce0591013 to your computer and use it in GitHub Desktop.
spacy noun chunks japanese
import spacy
from spacy import displacy
from IPython.display import HTML, display
# change the model to en_core_web_sm/lg for english
nlp = spacy.load('ja_core_news_lg')
text= "アプリインフラWebサイト等幅広く手掛けます RPAAIシステム開発にも携わって頂きます HTML Javascript PHP Python JAVAの知識が身につきます "
def extract_noun_phrase_experience(doc):
a=[]
for np in doc.noun_chunks:
a.append(str(np))
return " ".join(a)
doc = nlp(text)
a= extract_noun_phrase_experience(doc)
a
# OUTPUT
#'アプリインフラWebサイト等 幅広く手掛けます RPAAIシステム開発 HTML Javascript PHP Python JAVA 知識 身'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment