Transcribe audio with Java utilizing Universal-1

We lately introduced our newest speech recognition mannequin, Universal-1, which achieves state-of-the-art speech-to-text accuracy. Trained on hundreds of thousands of hours of audio knowledge, Universal-1 demonstrates near-human accuracy, even with accented speech, background noise, and troublesome phrases like flight numbers and e mail addresses.
Universal-1 can also be an order of magnitude sooner than our earlier mannequin, Conformer-2, and helps English, Spanish, French, and German, with extra languages coming shortly.
Along with Universal-1, we’ve additionally launched two new lessons of fashions: Best and Nano.
- Best helps you to benefit from Universal-1 for functions the place accuracy is paramount.
- Nano is our new cost-effective various with assist for 99 totally different languages.
In this put up, you’ll learn to transcribe an audio file in your Java functions utilizing Universal-1 and Nano.
Set up the AssemblyAI Java SDK
The best strategy to transcribe audio is by utilizing considered one of our official SDKs.
To set up the AssemblyAI Java SDK, embrace the newest model of the SDK in your venture dependencies:
Maven:
<dependency>
<groupId>com.assemblyai</groupId>
<artifactId>assemblyai-java</artifactId>
<model>1.0.10</model>
</dependency>
Gradle:
dependencies {
implementation 'com.assemblyai:assemblyai-java:1.0.10'
}
Then import the SDK namespaces in your Java code.
import com.assemblyai.api.AssemblyAI;
import com.assemblyai.api.assets.transcripts.varieties.SpeechMannequin;
import com.assemblyai.api.assets.transcripts.varieties.Transcript;
import com.assemblyai.api.assets.transcripts.varieties.TranscriptOptionalParams;
Configure a brand new authenticated SDK shopper utilizing your AssemblyAI API key out of your account dashboard.
var shopper = AssemblyAI.builder()
.apiKey(System.getenv("ASSEMBLYAI_API_KEY"))
.construct();
You’ll discover all of the operations you want on the AssemblyAI occasion.
Transcribe an audio file utilizing Universal-1
All transcriptions use the Best class of fashions by default, so that you’ll all the time get the very best accuracy with none additional configuration.
Use the next code to transcribe an audio file from a URL utilizing Best:
Transcript transcript = shopper.transcripts().transcribe(
"https://storage.googleapis.com/aai-web-samples/5_common_sports_injuries.mp3"
);
if (transcript.getStatus().equals(TranscriptStanding.ERROR)) {
throw new Exception(transcript.getError().get());
}
System.out.println(transcript.getText().get());
If you as a substitute wish to transcribe a neighborhood file, create a File object pointing to the trail of the file to transcribe:
Transcript transcript = shopper.transcripts().transcribe(
new File("./audio.mp3")
);
Nano—a cheap various
Switching between Best and Nano is simply a matter of setting the speech mannequin parameter within the parameters builder. To use Nano, set the speechModel(...) to SpeechMannequin.NANO:
Transcript transcript = shopper.transcripts().transcribe(
"https://storage.googleapis.com/aai-web-samples/5_common_sports_injuries.mp3",
TranscriptOptionalParams.builder()
.speechModel(SpeechMannequin.NANO)
.construct()
);
Best, Nano and More with Audio Intelligence
We simply used Universal-1 by means of each the Best and Nano class of fashions to transcribe audio.
Next, there are numerous additional options that AssemblyAI provides past transcription to discover, resembling:
- Entity detection to robotically determine and categorize key data.
- Content moderation for detecting inappropriate content material in audio information to make sure that your content material is secure for all audiences.
- PII redaction to attenuate delicate details about people by robotically figuring out and eradicating it out of your transcript.
- LeMUR for making use of Large Language Models (LLMs) to audio knowledge in a single line of code.
You can even be taught extra about our strategy to creating superhuman Speech AI fashions on our Research web page.
HI-FI News
through News, Tutorials, AI Research https://ift.tt/wEQjtB6
April 15, 2024 at 06:01PM
-
Product on sale
Audiophile Vinyl Records Cleaning BundleOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Product on sale
Easy Start Vinyl Records Cleaning KitOriginal price was: €69.90.€59.90Current price is: €59.90. incl. VAT -
Vinyl Records Cleaner Easy Groove Concentrate€34.95 incl. VAT -
Easy Groove Super Set€199.00 incl. VAT -
Easy Groove Enzycaster – vinyl records prewash cleaner€34.95 incl. VAT -
Easy Groove Extreme MK. II- vinyl records prewash cleaner€45.00 incl. VAT -
Vinyl Records Cleaner – Easy Groove Virgin Concentrate€35.00 incl. VAT -
Easy Groove Spray&Wipe vinyl records cleaner€34.95 incl. VAT








