Free API to Generate Word Embeddings for Text and Images on November 5, 2018 rated 5.0 of 5

Free API to Generate Word Embeddings for Text and Images

0 Comments
Editor Ratings:
User Ratings:
[Total: 0    Average: 0/5]




Free API to Generate Word Embeddings for Text and Images on November 5, 2018 rated 5.0 of 5

Basilica is a free API to to generate Word Embeddings for Text and Images. This API is basically for Python that you can use to generate word embeddings from a specified image or a piece of text. Here you can run a simple code snippet from your PC using an API key to send the input data to the server and it will return the vectors of floats. After getting the embeddings, you can start using them in your ML algorithms like k-means clustering or linear regression. If you have some deep knowledge of Word2Vec in machine learning then you will easily figure it out what it does and its advantages in various real problems.

Word Embedding is a technique in AI to map the words into vectors of real numbers. They are helpful in many AI aspects like in a natural language processing tasks, sentimental analysis. Since this API supports images as well so you can generate word embeddings from any JPG image. And then using the embeds, you can train your models to perform what you want to perform. There are some examples of the use cases of this API that are mentioned on the website. And there is a documentation for advanced usage as well that you can read here.

Free API to Generate Word Embeddings for Text and Images

Using this Free API to Generate Word Embeddings for Text and Images:

Basilica is a simple and straightforward API which you can use. And getting started with this is simple too. However, if you are a complete beginner in this field then I will suggest you to stay away from it. First, learn about text and image processing in AI then think about it.

These are the simple steps to get started with this.

Step 1: Make sure that you have Python installed and then you can install it on you PC. Run the following command and it should do the installation work.

pip install basilica

Install Basilica

Step 2: To make the calls, you will simply need an API key. For that sign up for a free account on main website of Basilica. After that, copy the API that you have in your profile section.

Basilical api key

Step 3: The following are simple code snippets which can easily be executed to get the word embeddings. The first snippet is for generating the embeddings from an image and second from a price of text.

For an image:

import basilica
API_KEY = 'SLOW_DEMO_KEY'
with basilica.Connection(API_KEY) as c:
embedding = c.embed_image_file('images/dog.1.jpg')
print(embedding)

For text:

import basilica
sentences = [
"This is a sentence!",
"This is a similar sentence!",
"I don't think this sentence is very similar at all...",]
with basilica.Connection('SLOW_DEMO_KEY') as c:
embeddings = list(c.embed_sentences(sentences))
print(embeddings)

Basilica in action

Above, you can see the output in the command prompt that it produced in my case. You can extend the above snippets and store the data in a file as well. And you can use it in the same way whenever you want to. And you should also go through its documentation to explore it in more depth.

Final thoughts

Basilica is a very useful tool for people who are kind of in machine learning field. This API is really simple to use and you can easily use it on any platform. I don’t have very much knowledge of machine learning algorithms but the use cases of this API that I saw on Basilica website are really amazing. So, if you’ve been looking for something like this then you should get started with it.

Free API to Generate Word Embeddings for Text and Images on November 5, 2018 rated 5.0 of 5
Free API to Generate Word Embeddings for Text and Images on November 5, 2018 rated 5.0 of 5
Editor Ratings:
User Ratings:
[Total: 0    Average: 0/5]
Free/Paid: Free
Free API to Generate Word Embeddings for Text and Images on November 5, 2018 rated 5.0 of 5