Comments (4)
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.
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.
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.
POS Tagging now published in v0.15.0
from rust-bert.
Related Issues (20)
- Seek Assistance and Support for DeBERTa Model HOT 2
- Is multilabel prediction correct? HOT 1
- Evaluation fails when trying to extract keywords from a specific sentence HOT 2
- Please expose tonekizer params on models where `forward_t` is exposed
- Downloading a model to a local Directory HOT 4
- Question: Configuring ZeroShotClassificationModel with DeBERTaV2 - Documentation HOT 1
- Upgrade Cargo dependencies HOT 2
- GPT-2 text generation throws an unexpected error HOT 4
- Any plan to release a new version? HOT 2
- Question: is it ok to continue after OOM error from `encode`
- update to be working with torch 2.2.0
- support for huggingface access token
- Error on running example in Linux
- RemoteResource doesn't allow loading safetensors models
- linking with `cc` failed: exit status: 1
- Double free or corruption (fasttop) HOT 1
- The example for linking the lib is incorrect.
- Feature Request: inference with rust bert models in asynchronous web applications HOT 1
- Converted msmarco-distilbert-cos-v5 model with convert_model.py fails when loaded with Tch tensor error: cannot find the tensor named distilbert.transformer.layer.0.attention.v_lin.bias HOT 2
- Loading multi-file pytorch_model.bin files (eg. Mistral)? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-bert.