Skip to content

Commit

Permalink
Language API integration (#28535)
Browse files Browse the repository at this point in the history
  • Loading branch information
maririos authored and paterasMSFT committed Jun 14, 2022
1 parent 3cb1c80 commit a7cfdff
Show file tree
Hide file tree
Showing 735 changed files with 33,029 additions and 12,967 deletions.
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ known_content_issues:
- ['sdk/extensions/Microsoft.Azure.WebJobs.Extensions.Clients/README.md','azure-sdk-tools/issues/404']
- ['sdk/extensions/Microsoft.Extensions.Azure/README.md','azure-sdk-tools/issues/404']
- ['sdk/storage/Azure.Storage.Common/README.md','azure-sdk-tools/issues/404']
- ['sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md','https://github.com/Azure/azure-sdk-tools/issues/404']
- ['sdk/webpubsub/Azure.Messaging.WebPubSub/README.md', 'azure-sdk-tools/issues/404 - requires different name for auth section']

- ['sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md', '#25936: Needs Examples']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.TextAnalytics.Legacy", "src\Azure.AI.TextAnalytics.Legacy.csproj", "{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25CE0676-8F2C-497B-8FB5-7DA41A31F6F9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F99E1793-076D-4060-A0BD-71ED8FA9050D}
EndGlobalSection
EndGlobal
15 changes: 15 additions & 0 deletions sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Azure Cognitive Services Text Analytics code sharing library

This library is intended to serve as a common location for non-public code for the legacy REST API that is used by the [Azure Cognitive Services Text Analytics client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/textanalytics/Azure.AI.TextAnalytics). The Text Analytics library includes these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for more information.

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%textanalytics%2FAzure.AI.TextAnalytics.Legacy.Shared%2FREADME.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>Microsoft Azure.AI.TextAnalytics shared code library</AssemblyTitle>
<Version>1.0.0</Version>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<IsShippingLibrary>false</IsShippingLibrary>
<IsTestSupportProject>true</IsTestSupportProject>
<ExcludeRecordingFramework>true</ExcludeRecordingFramework>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
</PropertyGroup>

<!--
Global Warning Suppressions:
* AZC0012 - Single word class names are too generic for Entity.cs class
-->
<PropertyGroup>
<NoWarn>$(NoWarn);3021;AZC0012</NoWarn>
</PropertyGroup>

<!-- Include Azure.Core shared source needed to compile -->
<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)HashCodeBuilder.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" LinkBase="Shared/Core" />
<Compile Include="$(AzureCoreSharedSources)AzureKeyCredentialPolicy.cs" LinkBase="Shared/Core" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// <summary> Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). </summary>
[CodeGenModel("DocumentSentimentValue")]
internal enum DocumentSentimentValue
{
/// <summary> positive. </summary>
Positive,
/// <summary> neutral. </summary>
Neutral,
/// <summary> negative. </summary>
Negative,
/// <summary> mixed. </summary>
Mixed
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy
{
/// <summary>
/// JobManifestTasks.
/// </summary>
[CodeGenModel("JobManifestTasks")]
internal partial class JobManifestTasks
{
/// <summary>
/// EntityRecognitionTasks
/// </summary>
internal IList<EntitiesTask> EntityRecognitionTasks { get; set; }

/// <summary>
/// EntityRecognitionPiiTasks
/// </summary>
internal IList<PiiTask> EntityRecognitionPiiTasks { get; set; }

/// <summary>
/// KeyPhraseExtractionTasks
/// </summary>
internal IList<KeyPhrasesTask> KeyPhraseExtractionTasks { get; set; }

/// <summary>
/// EntityLinkingTasks
/// </summary>
internal IList<EntityLinkingTask> EntityLinkingTasks { get; set; }

/// <summary>
/// SentimentAnalysisTasks
/// </summary>
internal IList<SentimentAnalysisTask> SentimentAnalysisTasks { get; set; }

/// <summary>
/// ExtractiveSummarizationTasks
/// </summary>
public IList<ExtractiveSummarizationTask> ExtractiveSummarizationTasks { get; set; }

/// <summary>
/// CustomEntityRecognitionTasks
/// </summary>
internal IList<CustomEntitiesTask> CustomEntityRecognitionTasks { get; set; }

/// <summary>
/// CustomSingleClassificationTasks
/// </summary>
internal IList<CustomSingleClassificationTask> CustomSingleClassificationTasks { get; set; }

/// <summary>
/// CustomMultiClassificationTasks
/// </summary>
internal IList<CustomMultiClassificationTask> CustomMultiClassificationTasks { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.AI.TextAnalytics.Legacy.Models;

namespace Azure.AI.TextAnalytics.Legacy
{
/// <summary>
/// A word or phrase identified as a Personally Identifiable Information
/// that can be categorized as known type in a given taxonomy.
/// The set of categories recognized by the Text Analytics service is described at
/// <see href="https://aka.ms/tanerpii"/>.
/// </summary>
internal readonly struct PiiEntity
{
internal PiiEntity(Entity entity)
{
Category = entity.Category;
Text = entity.Text;
SubCategory = entity.Subcategory;
ConfidenceScore = entity.ConfidenceScore;
Offset = entity.Offset;
Length = entity.Length;
}

/// <summary>
/// Gets the entity text as it appears in the input document.
/// </summary>
public string Text { get; }

/// <summary>
/// Gets the PII entity category inferred by the Text Analytics service's
/// named entity recognition model, such as Financial Account
/// Identification/Social Security Number/Phone Number, etc.
/// The list of available categories is described at
/// <see href="https://aka.ms/tanerpii"/>.
/// </summary>
public PiiEntityLegacyCategory Category { get; }

/// <summary>
/// Gets the sub category of the entity inferred by the Text Analytics service's
/// named entity recognition model. This property may not have a value if
/// a sub category doesn't exist for this entity. The list of available categories and
/// subcategories is described at <see href="https://aka.ms/tanerpii"/>.
/// </summary>
public string SubCategory { get; }

/// <summary>
/// Gets a score between 0 and 1, indicating the confidence that the
/// text substring matches this inferred entity.
/// </summary>
public double ConfidenceScore { get; }

/// <summary>
/// Gets the starting position for the matching text in the input document.
/// </summary>
public int Offset { get; }

/// <summary>
/// Gets the length of the matching text in the input document.
/// </summary>
public int Length { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.CodeAnalysis;

namespace Azure.AI.TextAnalytics.Legacy
{
/// <summary>
/// The different domains of PII entities that users can filter requests by.
/// </summary>
internal enum PiiEntityDomain
{
/// <summary>
/// Don't apply any domain filter. This is the default value.
/// </summary>
None,
/// <summary>
/// Protected Health Information entities.
/// For more information see <see href="https://aka.ms/tanerpii"/>.
/// </summary>
ProtectedHealthInformation
}

[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Small extensions, good to keep here.")]
internal static class PiiEntityDomainExtensions
{
internal static string GetString(this PiiEntityDomain type)
{
return type switch
{
PiiEntityDomain.None => null,
PiiEntityDomain.ProtectedHealthInformation => "phi",
_ => null,
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using Azure.AI.TextAnalytics.Legacy.Models;
using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy
{
/// <summary>
/// PiiTaskParameters class.
/// </summary>
[CodeGenModel("PiiTaskParameters")]
internal partial class PiiTaskParameters
{
/// <summary> (Optional) describes the PII categories to return. </summary>
public IList<PiiEntityLegacyCategory> PiiCategories { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// <summary> The predicted Sentiment for the sentence. </summary>
[CodeGenModel("SentenceSentimentValue")]
internal enum SentenceSentimentValue
{
/// <summary> positive. </summary>
Positive,
/// <summary> neutral. </summary>
Neutral,
/// <summary> negative. </summary>
Negative
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// <summary> The type related to the target. </summary>
[CodeGenModel("TargetRelationType")]
internal enum TargetRelationType
{
/// <summary> assessment. </summary>
Assessment,
/// <summary> target. </summary>
Target
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.AI.TextAnalytics.Legacy.Models
{
/// <summary> Targeted sentiment in the sentence. </summary>
[CodeGenModel("TokenSentimentValue")]
internal enum TokenSentimentValue
{
/// <summary> positive. </summary>
Positive,
/// <summary> mixed. </summary>
Mixed,
/// <summary> negative. </summary>
Negative
}
}
/**/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a7cfdff

Please sign in to comment.