Categorygithub.com/mrincompetent/corenlp-client-go
modulepackage
0.0.1
Repository: https://github.com/mrincompetent/corenlp-client-go.git
Documentation: pkg.go.dev

# README

corenlp-client-go

A CoreNLP client written in Go which uses Protobuf for message serialization.

Usage

package main

import (
	"context"
	"log"
	"net/http"
	"time"

	"github.com/mrincompetent/corenlp-client-go"
)

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
	defer cancel()

	client, err := corenlp.New("http://127.0.0.1:9000", http.DefaultClient)
	if err != nil {
		log.Fatalf("failed to create a client: %v", err)
	}

	doc, err := client.Annotate(ctx, "this is a wonderful library", []string{"sentiment"})
	if err != nil {
		log.Fatalf("failed to annotate text: %v", err)
	}

	log.Println(*doc.Sentence[0].Sentiment) // Prints: Positive
}

License

This library is released under the Apache License, Version 2.0. See the LICENSE file for more details.

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
Default values for DependencyGraph_Edge fields.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
Enum value maps for Language.
Enum value maps for Language.
Enum value maps for NaturalLogicRelation.
Enum value maps for NaturalLogicRelation.
Enum value maps for Sentiment.
Enum value maps for Sentiment.

# Structs

No description provided by the author
A coreference chain.
No description provided by the author
A dependency graph representation.
No description provided by the author
No description provided by the author
A document; that is, the equivalent of an Annotation.
A representation of an entity in a relation.
No description provided by the author
A map from integers to strings.
A map from strings to strings.
No description provided by the author
An NER mention in the text .
A Natural Logic operator .
A syntactic parse tree, with scores.
The polarity of a word, according to Natural Logic .
A quotation marker in text .
A representation of a relation, mirroring RelationMention .
An OpenIE relation triple.
No description provided by the author
A message for requesting a semgrex Each sentence stores information about the tokens making up the corresponding graph An alternative would have been to use the existing Document or Sentence classes, but the problem with that is it would be ambiguous which dependency object to use.
No description provided by the author
The response from running a semgrex If you pass in M semgrex expressions and N dependency graphs, this returns MxN nested results.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The serialized version of a CoreMap representing a sentence.
An entailed sentence fragment.
No description provided by the author
A Span of text .
No description provided by the author
A Timex object, representing a temporal expression (TIMe EXpression) These fields are not *really* optional.
The serialized version of a Token (a CoreLabel).
The index of a token in a document, including the sentence index and the offset.
It's possible to send in a whole document, but we only care about the Sentences and Tokens.
The result will be a nested structure: repeated PatternMatch, one for each pattern each PatternMatch has a repeated Match, which tells you which sentence matched and where.
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

An enumeration for the valid languages allowed in CoreNLP .
The seven informative Natural Logic relations .
An enumeration of valid sentiment values for the sentiment classifier.