- Use Azure Cognitive Service for Language with the OpenXML SDK
- Prerequisites
- Get Started
- Follow the Tutorial
- Working Sample
- Next steps
In this repo there is a sample console app that uses the OpenXML SDK and Azure Cognitive Service for Language with tutorial modules showing how to write the code to open a Word document, examine its contents for PII and save a copy with the PII redacted.
- Visual Studio (community edition is OK)
- .NET 6.0
- git command line tools
- Word Processing app that can open .docx files such as LibreOffice or Word
-
Clone this repository to your local system.
git clone https://github.com/InteropEvents/DocumentAnalyzer.git
Pro tip: Clone the repo low in your folder hierarchy to avoid path length issues e.g.
C:\myrepos
-
Create an Azure account and Language Services resource and copy the API key and endpoint by following the steps in the setup document.
If you already have a API key and endpoint provided to you, skip this step.
Now that you have cloned the repo and have your API key and endpoint, you're ready to create your application.
-
First follow this document to create your console application with Visual Studio.
-
Next install the the dependencies with this document.
-
Then follow this document to write the application code.
For a working example of this app:
-
Clone this repo
-
Open
DocumentAnalyzer.csproj
with Visual Studio -
Replace the placeholders for the API key, endpoint, and file path in
Program.cs
-
Press
F5
-
Tutorials for the Open XML SDK are available on docs.microsoft.
-
Example apps are also available.
-
Contribute to the project on the OpenXML SDK repo
-
The documentation for Azure Cognitive Services for Language is available at docs.microsoft.
-
Sample code for C#, Java, JavaScript, and Python are also available at docs.microsoft.