Giter VIP home page Giter VIP logo

language's Introduction

language

This library helps consuming the Azure Cognitive Services API. Today, this API performs 3 kind of analyzis:

  • Tokenization
  • Tags
  • Linguistic tree

However, in Today's implementation, there is no single response combining both tokens & tags together. That's why I built this library, to ease the tag extraction.

Examples of use:

  • Clone or download this rep, or install the corresponding NuGet package Eyskens.CognitiveServices.Linguistics
  • Grab a key for the linguistic API

From there on, you can call the service in three different ways:

LinguisticsClient cli = new LinguisticsClient(""); AnalyzeTextResult res = await cli.AnalyzeTextAsync(new AnalyzeTextRequest( "I live in Brussels", new Guid[] { new Guid("4fa79af1-f22c-408d-98bb-b7d7aeef7f04"), new Guid("22a6b758-420f-4745-8a3c-46835a67c0d2"), new Guid("08ea174b-bfdb-4e64-987e-602f85da7f72")})) as AnalyzeTextResult

You pass the analyzers of your choice. This call is almost similar to calling the API directly. I put it there so that you could still use this package should the underlying MS API's answer body change.

An alternative to get directly the extracted tokens & tags is to use this construct:

AnalyzeTagResult res = await cli.AnalyzeTextAsync(new TagTextRequest("I live in Brussels. My name is Stephane Eyskens")) as AnalyzeTagResult; //res.TokensAndTags contains a list of tokens & tags together. //On top of it, you can start extracting verbs, nouns or adjectives directly using this kind of constructs: foreach (var verb in cli.GetVerbs(res.TokensAndTags)) { Console.WriteLine(verb.token + ":" + verb.tag); }

The above code allows you to easily extract the relevant information from a piece of text.

language's People

Contributors

stephaneey avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.