Code Monkey home page Code Monkey logo

react-native-mlkit-entity-extraction's Introduction

MLKitEntityExtraction

A MachineLearning Based Entity Extractor

Build Powerful React Native With Entity Extractor Amazing โšก๏ธ

MIT License

MLKitEntityExtractor
โšก๏ธ Multiple Language Support over 10 languages supported (full list)
๐Ÿ˜Ž Lazy loaded. download models when needed
๐Ÿ”„ Offline-first. no network required for using
๐Ÿ“ฑ Multiplatform. iOS, Android
โฑ Fast. About TO Migrating to RN New Arch(JSI)
๐Ÿ”— Relational. Built on MLKit Translation foundation
โš ๏ธ Static typing Full-Support TypeScript

Why MLKitEntityExtractor?

Most apps offer users very little interaction with text beyond the basic cut/copy/paste operations. Entity extraction improves the user experience inside your app by understanding text and allowing you to add helpful shortcuts based on context.

The Entity Extraction API allows you to recognize specific entities within static text and while you're typing. Once an entity is identified, you can easily enable different actions for the user based on the entity type. Supported entities included are:

Entity Example
Address 350 third street, Cambridge MA
Date-Time 2019/09/29, let's meet tomorrow at 6pm
Email address [email protected]
Flight Number (IATA flight codes only) LX37
IBAN CH52 0483 0000 0000 0000 9
ISBN (version 13 only) 978-1101904190
Money/Currency (Arabic numerals only) $12, 25 USD
Payment / Credit Cards 4111 1111 1111 1111
Phone Number (555) 225-3556 12345
Tracking Number (standardized international formats) 1Z204E380338943508
URL www.google.com https://en.wikipedia.org/wiki/Platypus

This API focuses on precision over recognition. Some instances of a particular entity might not be detected in favor of ensuring accuracy.

Installation

yarn add react-native-mlkit-entity-extraction

or

npm i --save react-native-mlkit-entity-extraction

! Android Special

// 31 is required !
compileSdkVersion = 31
targetSdkVersion = 31

Usage

Quick example: identify language type

import MLKitEntityExtraction from './MLKitEntityExtraction';

const text = "My flight is LX373, please pick me up at 8am tomorrow. You can look up at http://github.com";

MLKitEntityExtraction.isModelDownloaded('ENGLISH')
    .then(v => {
		if (v) {
			//extrac it right now
            MLKitEntityExtraction.annotate(
                text,
                'ENGLISH',
                ['TYPE_FLIGHT_NUMBER','TYPE_DATE_TIME','TYPE_URL']
            ).then(v => {
				setExtractions(v);
			}).catch(e => {
                //something wrong
			})
		}else{
			//download model
			MLKitEntityExtraction
                .downloadModel('ENGLISH')
                .then(rs => {
					//download success
				}).catch(e => {
					//something wrong
				})
			}
	});

Remember !!! โœจ Always check model firstly ; Do not translate text if the model is not downloaded

use MLKitEntityExtraction.isModelDownloaded to check

Full Support Language

  • ARABIC
  • GERMAN
  • ENGLISH
  • SPANISH
  • FRENCH
  • ITALIAN
  • JAPANESE
  • KOREAN
  • DUTCH
  • POLISH
  • PORTUGUESE
  • RUSSIAN
  • THAI
  • TURKISH
  • CHINESE

All Supported Entity Type

  • ADDRESS
  • DATE_TIME
  • EMAIL
  • FLIGHT_NUMBER
  • IBAN
  • ISBN
  • PAYMENT_CARD
  • PHONE
  • TRACKING_NUMBER
  • URL
  • MONEY

Author and license

WatermelonDB was created by @yaaliuzhipeng

react-native-mlkit-translate-text is available under the MIT license. See the LICENSE file for more info.

react-native-mlkit-entity-extraction's People

Contributors

kevmac19 avatar tfcornerstone avatar yaaliuzhipeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-mlkit-entity-extraction's Issues

Version clashing when using with react-native-mlkit-ocr

Gives error using react-native-mlkit-entity-extraction package with react-native-mlkit-ocr

Error is coming while installing pods

OCR package podspec version of GoogleMLKit

s.dependency "GoogleMLKit/TextRecognition", "2.6.0"

Entity-extraction package podspec version of GoogleMLKit

s.dependency "GoogleMLKit/EntityExtraction", "2.5.0"

Solution : Inline this package GoogleMLKit pods version with react-native-mlkit-ocr

@yaaliuzhipeng
PR - Updated GoogleMLKit pods version to inline with RN-OCR package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.