You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we used the original response from the Google Cloud Vision API and it's a string with a line break (\n) character for each word. So, we want to make it dynamic. It should have a pattern to choose which text you want to extract from the image.
For example, if we extract Indonesia's resident ID (KTP), we only want to get the name and the date of birth. So, we need to add a pattern to the extract function. It should look like this:
and if we call it based on the example above, it should look like this:
interfaceResponse{name: string;birthdate: string;}constextractor=newImageTextExtraction({apiKey: 'your-key'});constresponse=awaitextractor<Response>(image,{pattern: 'nama|tanggal lahir'// pattern text based on image});
then, the response should be like this:
{name: 'John Doe',birthdate: '1 January 2023'}
The text was updated successfully, but these errors were encountered:
Currently, we used the original response from the Google Cloud Vision API and it's a
string
with a line break (\n
) character for each word. So, we want to make it dynamic. It should have a pattern to choose which text you want to extract from the image.For example, if we extract Indonesia's resident ID (KTP), we only want to get the name and the date of birth. So, we need to add a pattern to the
extract
function. It should look like this:and if we call it based on the example above, it should look like this:
then, the response should be like this:
The text was updated successfully, but these errors were encountered: