Ohenepee Peps
Ohenepee Peps

Reputation: 167

How to get Part-Of-Speech tags w/o fluff

Is there any way to get POS tags without any other chaff?

let doc = nlp("I am a librarian at the Yale University, do you know what that is?")
console.log(doc.out("tags"))

The above prints POS tags along side named entities and other stuff I'm not interested in. I just want the "all so basic" POS tags.

Upvotes: 1

Views: 150

Answers (1)

adil
adil

Reputation: 23

You can resolve this using a map function. Try this.

console.log(doc.out("tags").map(obj => obj.tags))

Upvotes: 2

Related Questions