-
Notifications
You must be signed in to change notification settings - Fork 213
Adding Transcription to Convert Functionality for Offline and Online #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Show resolved
Hide resolved
AmplifyPlugins/Predictions/CoreMLPredictionsPlugin/Dependency/CoreMLSpeechBehavior.swift
Show resolved
Hide resolved
revert podfile
…/aws-amplify/amplify-ios into kneekey/predictions-transcribe-3
Amplify/Categories/Predictions/PredictionsCategory+ClientBehavior.swift
Outdated
Show resolved
Hide resolved
Amplify/Categories/Predictions/Request/PredictionsConvertRequest.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/Predictions/AWSPredictionsPlugin/Dependency/AWSTranscribeStreamingBehavior.swift
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
|
||
class NativeWebSocketProvider: NSObject, AWSTranscribeStreamingWebSocketProvider, URLSessionWebSocketDelegate { | ||
//swiftlint:disable weak_delegate | ||
var clientDelegate: AWSTranscribeStreamingClientDelegate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt this be weak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't be weak per the protocol from AWSTranscribeStreamingWebSocketProvider and I am not holding a reference to this delegate property from this class on any other class. I am instantiating a new class below that inherits from this protocol so I don't think it has to be weak in this case?
AmplifyPlugins/Predictions/AWSPredictionsPlugin/Support/Internal/NativeWebSocketProvider.swift
Outdated
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/Predictions/CoreMLPredictionsPlugin/Dependency/CoreMLSpeechAdapter.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Still have concerns regarding concurrent requests.
We create a websocket connection per request, but we donot keep track of it.NativeWebSocketProvider
overrides each websocket tasks at line 31. I guess we need to keep track of each websocket connection so that, we can send the right endFrame messages to the right socket. -
I have merged in another PR for the copyright files. You can rebase from master so that we can get rid of all the copyright year files.
AmplifyPlugins/Predictions/AWSPredictionsPlugin/Dependency/AWSTranscribeStreamingBehavior.swift
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/Predictions/AWSPredictionsPlugin/Support/Internal/NativeWebSocketProvider.swift
Outdated
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
.../Predictions/AWSPredictionsPlugin/Service/Predictions/AWSPredictionsService+Transcribe.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/Predictions/AWSPredictionsPlugin/AWSPredictionsPlugin+ClientBehavior.swift
Outdated
Show resolved
Hide resolved
Decided to have convert() api for transcribe to have one request at a time and it doesnot support concurrent convert operation. So internally the streaming works as request/response model for now. |
Description of changes:
Transcription added under convert as an api call to both online and offline services supported by CoreML and AWS. In addition to a refactor in order for convert to take advantage of multiservice functionality that will change customer code upon receiving ConvertResult.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.