| Crates.io | candle-crf |
| lib.rs | candle-crf |
| version | 0.8.8 |
| created_at | 2024-07-16 14:40:07.853191+00 |
| updated_at | 2025-04-06 01:07:47.089846+00 |
| description | porting pytorch-crf to candle |
| homepage | |
| repository | https://github.com/kigichang/candle-crf |
| max_upload_size | |
| id | 1305125 |
| size | 143,252 |
Candle CRF ports pytorch-crf to Huggingface Candle.
Pytorch CRF
crf = CRF(num_tags, batch_first=false)
Candle CRF
let crf = CRF::new(num_tags, false, &candle_core::Device::Cpu).unwrap();
Pytorch CRF
llh = crf(emissions, tags, mask)
Candle CRF
let llh = crf
.forward(&emissions, &tags, Some(&mask), Reduction::default())
.unwrap();
Pytorch CRF
best_tags = crf.decode(emissions, mask)
Candle CRF
let best_tags = crf.decode(&emissions, Some(&mask)).unwrap();