public class ConceptInsights extends WatsonService
Modifier and Type | Field and Description |
---|---|
static String |
CONCEPT
The Constant CONCEPT.
|
static String |
CONCEPT_FIELDS
The Constant CONCEPT_FIELDS.
|
static String |
CONCEPTS
The Constant CONCEPTS.
|
static String |
CURSOR
The Constant CURSOR.
|
static String |
DOCUMENT_FIELDS
The Constant DOCUMENT_FIELDS.
|
static String |
DOCUMENTS_PATH
The Constant DOCUMENTS.
|
static String |
IDS
The Constant IDS.
|
static String |
LEVEL
The Constant LEVEL.
|
static String |
LIMIT
The Constant LIMIT.
|
static String |
PREFIX
The Constant PREFIX.
|
static String |
QUERY
The Constant query.
|
static String |
TEXT
The Constant TEXT.
|
VERSION
Constructor and Description |
---|
ConceptInsights()
Instantiates a new Concept Insights service.
|
Modifier and Type | Method and Description |
---|---|
Annotations |
annotateText(Graph graph,
String text)
Identifies concepts in a piece of text.
|
QueryConcepts |
conceptualSearch(Corpus corpus,
Map<String,Object> parameters)
Performs a conceptual search within a corpus.
|
void |
createCorpus(Corpus corpus)
Creates an empty corpus.
|
void |
createDocument(Document document)
Creates a document in a given corpus.
|
void |
deleteCorpus(Corpus corpus)
Deletes a corpus by ID.
|
void |
deleteDocument(Document document)
Deletes a document in a given corpus.
|
Accounts |
getAccountsInfo()
Retrieves the account identifiers.
|
ConceptMetadata |
getConcept(Concept concept)
Returns information for a specific concept node in a graph.
|
Concepts |
getConceptRelatedConcepts(Concept concept,
Map<String,Object> parameters)
Searches for graph concepts from a Concept by using partial matches.
|
Corpus |
getCorpus(Corpus corpus)
Retrieves corpus object to a list of individual concepts.
|
CorpusProcessingState |
getCorpusProcessingState(Corpus corpus)
Gets processing state of a Corpus.
|
Concepts |
getCorpusRelatedConcepts(Corpus corpus,
Map<String,Object> parameters)
Retrieves concepts that are related to an entire corpus.
|
Scores |
getCorpusRelationScores(Corpus corpus,
List<Concept> concepts)
Returns a list of scores that denotes how related an entire corpus is to a list of individual
concepts.
|
CorpusStats |
getCorpusStats(Corpus corpus)
Gets processing state of a Corpus.
|
Document |
getDocument(Document document)
Retrieves a document from a corpus.
|
DocumentAnnotations |
getDocumentAnnotations(Document document)
Retrieves conceptual view of document (including annotations).
|
DocumentProcessingStatus |
getDocumentProcessingState(Document document)
Retrieves processing state of document.
|
Concepts |
getDocumentRelatedConcepts(Document document,
Map<String,Object> parameters)
Retrieves concepts that are related (in conceptual sense) to a given document.
|
Scores |
getDocumentRelationScores(Document document,
List<Concept> concepts)
Returns a list of scores that denotes how related a document is to a list of concepts.
|
Concepts |
getGraphRelatedConcepts(Graph graph,
List<Concept> concepts,
Map<String,Object> parameters)
Searches for graph concepts by using partial matches.
|
Scores |
getGraphRelationScores(Concept concept,
List<String> concepts)
Returns a list of scores that denotes how related a source concept is to a list of individual
concepts.
|
Corpora |
listCorpora()
Retrieves the available corpus objects.
|
Corpora |
listCorpora(String accountId)
Retrieves the available corpus objects associated with an account identifier.
|
Documents |
listDocuments(Corpus corpus,
Map<String,Object> parameters)
Retrieves the document ids of a corpus.
|
Graphs |
listGraphs()
Retrieves the available
Graphs . |
Matches |
searchCorpusByLabel(Corpus corpus,
Map<String,Object> parameters)
Searches for documents and concepts by using partial matches on the label(s) fields.
|
Matches |
searchGraphsConceptByLabel(Graph graph,
Map<String,Object> parameters)
Searches for graph concepts by using partial matches.
|
void |
updateCorpus(Corpus corpus)
Updates existing corpus meta-data (access and permissions).
|
void |
updateDocument(Document document)
Updates a document in a given corpus.
|
configureHttpClient, execute, executeRequest, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toString
public static final String CONCEPT
public static final String CONCEPT_FIELDS
public static final String CONCEPTS
public static final String CURSOR
public static final String DOCUMENT_FIELDS
public static final String DOCUMENTS_PATH
public static final String IDS
public static final String LEVEL
public static final String LIMIT
public static final String PREFIX
public static final String QUERY
public static final String TEXT
public ConceptInsights()
public Annotations annotateText(Graph graph, String text)
graph
- - The graph object.text
- - The text to annotate.Annotations
public QueryConcepts conceptualSearch(Corpus corpus, Map<String,Object> parameters)
corpus
- the corpusparameters
- The parameters to be used in the service call ids is required.
QueryConcepts
public void createCorpus(Corpus corpus)
corpus
- Corpus the corpus object.public void createDocument(Document document)
document
- Document
The document to create.public void deleteCorpus(Corpus corpus)
corpus
- Corpus the corpus object.public void deleteDocument(Document document)
document
- Document the document.public Accounts getAccountsInfo()
Accounts
public ConceptMetadata getConcept(Concept concept)
concept
- Concept the concept object.ConceptMetadata
public Concepts getConceptRelatedConcepts(Concept concept, Map<String,Object> parameters)
concept
- the conceptparameters
- The parameters to be used in the service call.
Concepts
public Corpus getCorpus(Corpus corpus)
corpus
- Corpus the corpus object.public CorpusProcessingState getCorpusProcessingState(Corpus corpus)
corpus
- Corpus the corpus object.CorpusProcessingState
The processing state of a given corpus.public Concepts getCorpusRelatedConcepts(Corpus corpus, Map<String,Object> parameters)
corpus
- the corpusparameters
- The parameters to be used in the service call.
Concepts
public Scores getCorpusRelationScores(Corpus corpus, List<Concept> concepts)
corpus
- The corpus objectconcepts
- Array of concept IDs, each identifying a conceptScores
public CorpusStats getCorpusStats(Corpus corpus)
corpus
- The corpus objectCorpusStats
public Document getDocument(Document document)
document
- Document the document object,Document
public DocumentAnnotations getDocumentAnnotations(Document document)
document
- Document the document object,DocumentAnnotations
public DocumentProcessingStatus getDocumentProcessingState(Document document)
document
- Document the document object,DocumentProcessingStatus
public Concepts getDocumentRelatedConcepts(Document document, Map<String,Object> parameters)
document
- the documentparameters
- The parameters to be used in the service call.
Concepts
public Scores getDocumentRelationScores(Document document, List<Concept> concepts)
document
- Document the document object,concepts
- the conceptsScores
public Concepts getGraphRelatedConcepts(Graph graph, List<Concept> concepts, Map<String,Object> parameters)
graph
- the graphconcepts
- the conceptsparameters
- The parameters to be used in the service call, graph and concepts are
required.
Concepts
public Scores getGraphRelationScores(Concept concept, List<String> concepts)
concept
- Concept the concept object,concepts
- Array of concept IDs, each identifying a concept.Scores
public Corpora listCorpora(String accountId)
accountId
- The account identifier.Corpora
public Documents listDocuments(Corpus corpus, Map<String,Object> parameters)
corpus
- the corpusparameters
- The parameters to be used in the service call.
Documents
public Matches searchCorpusByLabel(Corpus corpus, Map<String,Object> parameters)
corpus
- the corpusparameters
- The parameters to be used in the service call query is required.
Matches
public Matches searchGraphsConceptByLabel(Graph graph, Map<String,Object> parameters)
graph
- the graphparameters
- The parameters to be used in the service call, account_id, graph and query
are required.
Matches
public void updateCorpus(Corpus corpus)
corpus
- Corpus
the corpus to update.Copyright © 2015–2016. All rights reserved.