-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cb1c80
commit a7cfdff
Showing
735 changed files
with
33,029 additions
and
12,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/Azure.AI.TextAnalytics.Legacy.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
15
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
35 changes: 35 additions & 0 deletions
35
...xtanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Azure.AI.TextAnalytics.Legacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
21 changes: 21 additions & 0 deletions
21
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/DocumentSentimentValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/JobManifestTasks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiEntityDomain.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/PiiTaskParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/SentenceSentimentValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TargetRelationType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/src/Custom/TokenSentimentValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
/**/ |
2 changes: 1 addition & 1 deletion
2
...ted/Models/AnalysisInput.Serialization.cs → ...ted/Models/AnalysisInput.Serialization.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ics/src/Generated/Models/AnalysisInput.cs → ...red/src/Generated/Models/AnalysisInput.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...Models/AnalyzeBatchInput.Serialization.cs → ...Models/AnalyzeBatchInput.Serialization.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
...src/Generated/Models/AnalyzeBatchInput.cs → ...src/Generated/Models/AnalyzeBatchInput.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ls/AnalyzeJobDisplayName.Serialization.cs → ...ls/AnalyzeJobDisplayName.Serialization.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.