Extract Entities using NLP in Go
Natural Language Processing (NLP) combines linguistics and artificial intelligence to analyze natural language data in large quantities. This technology has proven to be incredibly useful across a wide range of industries, organizations, and project due its ability to simplify the scanning of content by categorizing and organizing it through machine learning. The process of extracting names entities from code can be a tedious and frustrating task, but by utilizing the following NLP API In Go, we will be able to accomplish it in no time at all.
To begin the operation, simply input your target string and API key into the below code:
package mainimport (
"fmt"
"strings"
"net/http"
"io/ioutil"
)func main() {url := "https://api.cloudmersive.com/nlp-v2/extract-entities"
method := "POST"payload := strings.NewReader("InputString=%3Cstring%3E")client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
And there you have it! If you need to retrieve your API key, you can register for a free account on the Cloudmersive website; this will provide access to 800 monthly calls across any of our APIs.