There's more...

The Google News vector's compressed model file is sized at 1.6 GB. It can take a while to load and evaluate the model. You might observe an OutOfMemoryError error if you're running the code for the first time:

We now need to adjust the VM options to accommodate more memory for the application. You can adjust the VM options in IntelliJ IDE, as shown in the following screenshot. You just need to make sure that you assign enough memory value and restart the application:

Get Java Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.