Giter VIP home page Giter VIP logo

office-file-api-ai-implementation's Introduction

Office File API – Integrate AI

The following project integrates AI capabilities into a DevExpress-powered Office File API Web API application. This project uses the following AI services:

  • OpenAI API generates descriptions for images, charts and hyperlinks in Microsoft Word and Excel files.
  • Azure AI Language API detects the language for text paragraphs in Word files.
  • Azure AI Translator API translates paragraph text to the chosen language in Word files.

Note

Before you incorporate this solution in your app, please be sure to read and understand terms and conditions of using AI services.

Implementation Details

The project uses the Azure.AI.OpenAI, Azure.AI.TextAnalytics and Azure.AI.Translation.Text NuGet packages. Azure.AI.OpenAI adapts OpenAI's REST APIs for use in non-Azure OpenAI development. Azure.AI.TextAnalytics and Azure.AI.Translation.Text require an Azure subscription. Once you obtain it, create a Language resource and a Translator resource (or a single multi-service resource) in the Azure portal to get your keys and endpoints for client authentication.

OpenAIController includes endpoints to generate image, chart and hyperlink descriptions. The OpenAIClientImageHelper class sends a request to describe an image and obtains a string with a response. The OpenAIClientHyperlinkHelper class sends a request to describe an hyperlink and obtains a string with a response. The OpenAIClientImageHelper.DescribeImageAsync and OpenAIClientHyperlinkHelper.DescribeHyperlinkAsync methods are executed within the corresponding endpoints. For Excel files, charts are converted to images to obtain relevant descriptions.

LanguageController includes the endpoint to detect the language for text paragraphs and generate paragraph transaltions. The AzureAILanguageHelper class sends a request to detect the language of the specified text and returns the language name in the "ISO 693-1" format. The AzureAITranslationHelper class sends a request to translate the given text to the specified language and returns the transaled text string. The AzureAILanguageHelper.DetectTextLanguage and AzureAITranslationHelper.TranslateText methods are executed in the GenerateLanguageSettingsForParagraphs endpoint.

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

office-file-api-ai-implementation's People

Contributors

dxmaria avatar geumjalee avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hindermath

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.