News for hackers. Stuff that matters.
Re:How to calculate the alignment between BERT and spaCy tokens by cochne on Monday July 12, 2021 @10:37PM (#27817156)
This is exactly why tokenizers should provide offsets into the original text! The Spacy tokenizer provides this, though the original wordpiece tokenizer provided for BERT does not. It is relatively easy to add offset information to that tokenizer, though. After you have start and end offsets for each token, it's not hard to just align tokens by offset overlap.
Re:How to calculate the alignment between BERT and spaCy tokens by PeterisP on Thursday July 15, 2021 @01:31PM (#27847337)
Huggingface tokenizers (e.g. BertTokenizerFast which can load the BERT model vocabularies) also can provide the offsets into the original text.
Re:How to calculate the alignment between BERT and spaCy tokens by tracyhenry on Tuesday July 13, 2021 @12:39AM (#27817676)
Can someone explain how BERT and spaCy are typically combined in practice for a custom NER task?
Re:How to calculate the alignment between BERT and spaCy tokens by tastroder on Tuesday July 13, 2021 @04:56AM (#27818845)
These days, at least in non-research contexts, people seem to mostly use spacy-transformers for that, already contains all the necessary glue code between huggingface transformers (including BERT) and spacy.

https://explosion.ai/blog/spacy-transformers / https://spacy.io/universe/project/spacy-transformers

Re:How to calculate the alignment between BERT and spaCy tokens by fouc on Tuesday July 13, 2021 @04:37AM (#27818753)
Does anyone know how those beautiful "terminal" images were generated? Or recommend some resources for how to make similar images? Or how to actually configure iterm2/vim/etc to that point?
Re:How to calculate the alignment between BERT and spaCy tokens by polm23 on Tuesday July 13, 2021 @04:46AM (#27818793)
Re:How to calculate the alignment between BERT and spaCy tokens by occupy_paul_st on Monday July 12, 2021 @11:39PM (#27817410)
Clicked on this thinking it was some kind of crazy decentralized crypto algorithm... yeesh, I gotta spend less time on the blockchain!!