GithubHelp home page GithubHelp logo

Comments (4)

guillaume-be avatar guillaume-be commented on May 11, 2024

Hello @browndw ,

You are right that both pipelines are very similar. The only differences are a different default model architecture and post-processing pipeline. This is a copy/paste mistake on my end for the documentation, I am pushing an update to fix this (#140).

The correct way to create an call a POS model should be:

use rust_bert::pipelines::pos_tagging::POSModel;

fn main() -> anyhow::Result<()> {
  let pos_model = POSModel::new(Default::default())?;
  let input = [
    "My name is Bob",
  ];
  let output = pos_model.predict(&input);
}

returning:

[
    POSTag {
        word: String::from("My"),
        score: 0.1560,
        label: String::from("PRP"),
    },
    POSTag {
        word: String::from("name"),
        score: 0.6565,
        label: String::from("NN"),
    },
    POSTag {
        word: String::from("is"),
        score: 0.3697,
        label: String::from("VBZ"),
    },
    POSTag {
        word: String::from("Bob"),
        score: 0.7460,
        label: String::from("NNP"),
    },
]

from rust-bert.

browndw avatar browndw commented on May 11, 2024

Thanks so much! Got it working. But just FYI, I had to set the dependency to the github repository rather than the default crates.io. That crate doesn't include pos_tagging.rs in the pipelines directory (or at least its path doesn't appear in the deps folder preventing it from compiling). And again, thanks for the terrific resource.

from rust-bert.

guillaume-be avatar guillaume-be commented on May 11, 2024

Glad it worked out!

Yes - the POS tagging has not been released yet (changelogs are available at https://github.com/guillaume-be/rust-bert/blob/master/CHANGELOG.md). I am planning a new release this weekend so you should be able to pull it from crates.io by then.

from rust-bert.

guillaume-be avatar guillaume-be commented on May 11, 2024

POS Tagging now published in v0.15.0

from rust-bert.

Related Issues (20)

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.