GetAspectsSuggestions input: string Query, string[] Documents, enum DocumentFormat, int NumberOfResults output: AspectFacet[] AspectsSuggestionsResult
Takes as an input a Query, a list of Documents and their DocumentFormat : text or URL, as well as
the NumberOfResults to restrict the set of aspect suggestions.
It is assumed that the documents match the query, e.g. were returned by a search engine.
Suggests more specific terms that represent some aspects of the query.
The AspectFacet object stores the original query term, the aspect term and the score.
Sample code in C#:
PingarAPIRequest request = new PingarAPIRequest();
request.AppID = "your app id";
request.AppKey = "your app key";
request.SearchSupport = new SearchSupportRequest();
request.SearchSupport.Query = "sample query";
request.SearchSupport.NumberOfResults = 5;
request.SearchSupport.Documents = new string[] { "document text" };
request.SearchSupport.DocumentsFormat = DocumentFormat.Text;
request.Language = Language.EN;
PingarAPIServiceSoapClient pingarAPI = new PingarAPIServiceSoapClient();
PingarAPIResponse response = pingarAPI.GetAspectsSuggestions(request);
if (response.Error == null)
{
Console.WriteLine("Aspect Suggestions: ");
foreach (AspectFacet aspect in response.SearchSupport.AspectsSuggestionsResult)
{
Console.WriteLine(aspect.qTerm + " > " + aspect.Title
+ " (" + aspect.Score + ")");
}
}