Created
July 15, 2018 23:27
-
-
Save jdkato/099632098e3273fa56e2a5be77e7932c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "gopkg.in/jdkato/prose.v2" | |
| ) | |
| func main() { | |
| // Load our model, which we saved to a directory named "PRODUCT". | |
| model := prose.ModelFromDisk("PRODUCT") | |
| doc, err := prose.NewDocument( | |
| "Windows 10 is a computer operating system released in 2015.", | |
| prose.WithSegmentation(false), | |
| prose.UsingModel(model)) | |
| if err != nil { | |
| panic(err) | |
| } | |
| // Iterate over the doc's named-entities: | |
| for _, ent := range doc.Entities() { | |
| fmt.Println(ent.Text, ent.Label) | |
| // Windows 10 PRODUCT | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment