Skip to content

feat: Adding capability use Cognitive Service Language Service asynchronously for Summarization#2342

Merged
mhamilton723 merged 8 commits into
microsoft:masterfrom
FarrukhMasud:add-summarization
Feb 6, 2025
Merged

feat: Adding capability use Cognitive Service Language Service asynchronously for Summarization#2342
mhamilton723 merged 8 commits into
microsoft:masterfrom
FarrukhMasud:add-summarization

Conversation

@FarrukhMasud

@FarrukhMasud FarrukhMasud commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Adding a new capability to use Cognitive Service Language Service asynchronously.

The transformer calls the async service and poll for result. The polling delay and max retry attempts is controlled by parameters. Request creation for each task is extracted into separate trait to make code more readable and manageable. There has been minimal changes in AnalyzeText class.

In this PR we adding support for following tasks

  • ExtractiveSummarization
  • AbstractiveSummarization
  • Healthcare
  • SentimentAnalysis
  • KeyPhraseExtraction
  • PiiEntityRecognition
  • EntityLinking
  • EntityRecognition
  • CustomEntityRecognition
  • CustomMultiLabelClassification
  • CustomSingleLabelClassification

How is this patch tested?

Using unit tests, I have called each service and validated that transformer is working.

  • I have written tests (not required for typo or doc fix) and confirmed the proposed feature/bug-fix/change works.

Does this PR change any dependencies?

  • No. You can skip this section.
  • Yes. Make sure the dependencies are resolved correctly, and list changes here.

Does this PR add a new feature? If so, have you added samples on website?

  • No. You can skip this section.

…ly. The transformer calls the async service and poll for result. The polling delay and max retry attempts is controlled by parameters. Request creation for each task is extracted into separate trait to make code more readable and manageable. There has been minimal changes in AnalyzeText class.
@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud FarrukhMasud changed the title Adding capability use Cognitive Service Language Service asynchronous… feat: Adding capability use Cognitive Service Language Service asynchronously for Summarization Jan 29, 2025
//------------------------------------------------------------------------------------------------------
// Abstractive Summarization
//------------------------------------------------------------------------------------------------------
object SummaryLength extends Enumeration {

@mhamilton723 mhamilton723 Jan 29, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the spark bindings API handle enums? How does this look in the schema of the dataframe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a helper enum, the field in the class is of type string

@codecov-commenter

codecov-commenter commented Jan 29, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.57143% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.66%. Comparing base (bab6aed) to head (ae38829).
⚠️ Report is 121 commits behind head on master.

Files with missing lines Patch % Lines
...se/ml/services/language/AnalyzeTextLROTraits.scala 87.62% 25 Missing ⚠️
...es/language/AnalyzeTextLongRunningOperations.scala 98.94% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2342      +/-   ##
==========================================
+ Coverage   84.55%   84.66%   +0.10%     
==========================================
  Files         328      331       +3     
  Lines       16848    17177     +329     
  Branches     1513     1526      +13     
==========================================
+ Hits        14246    14543     +297     
- Misses       2602     2634      +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

…classification. Unit tests are added to validate that requests and response are correct. Also added tiemout for AbstractiveSummary requests.
@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@FarrukhMasud

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mhamilton723 mhamilton723 merged commit 1b5df70 into microsoft:master Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants