npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-mlkit-entity-extraction

v1.0.0

Published

text entity extraction; based on google mlkits

Downloads

6

Readme

| | 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.