1.4.11 • Published 1 year ago

ingredient-instruction-classifier v1.4.11

Weekly downloads
15
License
AGPL-3.0-only
Repository
github
Last release
1 year 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

1 year ago

1.4.10

1 year ago

1.4.9

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.4.4

2 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago