spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

can't not use wordpieces in Spacy 3.7.5 with en_core_web_trf

Open origi6615 opened this issue 1 week ago • 0 comments

When I run

import spacy nlp = spacy.load("en_core_web_trf") utt8 = nlp("It went there unwillingly.") utt8._.trf_data.wordpieces

it meet error, so I run

utt8 = utt8._.trf_data print(dir(utt8)) ['annotations', 'class', 'dataclass_fields', 'dataclass_params', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getstate', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'match_args', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', 'all_hidden_layer_states', 'all_outputs', 'embedding_layer', 'from_dict', 'last_hidden_layer_state', 'last_layer_only', 'num_outputs', 'to_dict']

so which one I can choose to replace wordpieces in this 3.7.x version, thank you!

How to reproduce the behaviour

Your Environment

  • Operating System:
  • Python Version Used:
  • spaCy Version Used:
  • Environment Information:

origi6615 avatar Jun 23 '24 11:06 origi6615