1.4.11 • Published 4 months ago

ingredient-instruction-classifier v1.4.11

Weekly downloads
15
License
AGPL-3.0-only
Repository
github
Last release
4 months ago

Ingredient & Instruction Classifier

This repository contains a TensorFlow model and example express server for classifying sentences as either ingredient, instruction, or other.

This is particularly useful when pulling recipe information from a site (see https://github.com/julianpoy/recipeclipper ).

Usage

The TensorFlow model exists in the model folder. The src/server.js file provides an example of usage.

The example server can easily be spun up with docker-compose.

To use within a node project:

const predict = require('@julianpoy/ingredient-instruction-classifier/src/predict.js');

const sentences = [
  "1 lb all purpose flour",
  "add all purpose flour to mixing bowl",
  "I absolutely love cooking, it's my favorite pastime",
];

const results = await predict(sentences);

// Results is array of arrays:
[
  [float, float, float] // Result for sentence one
  [float, float, float] // Result for sentence two
  ...
];

// Array positions:
// Idx 0: Ingredient
// Idx 1: Instruction
// Idx 2: Non-recipe text
1.4.11

4 months ago

1.4.10

5 months ago

1.4.9

8 months ago

1.4.6

11 months ago

1.4.5

11 months ago

1.4.8

11 months ago

1.4.7

11 months ago

1.4.4

1 year ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago