Code Monkey home page Code Monkey logo

Comments (1)

kosugi11037 avatar kosugi11037 commented on September 7, 2024

Thanks for your interest in our work! I think the error is due to differences between different versions of transformers (I guess you use transformer version 4.X). You can resolve this error in two ways:

(a). Using transformers version 2.1.1
or
(b). Modify the code to make it work for the transformer version you are using. For example, you can:

  • change the line 36 of basic_bert_unit/Read_data_func.py to encode_indexs = Tokenizer.encode(string, truncation = True, max_length = des_limit, add_special_tokens = False)
  • change the line 55 of basic_bert_unit/Read_data_func.py to token_ids = Tokenizer.encode(ent_name, truncation = True, max_length = ent_name_max_length, add_special_tokens = False)
  • change the line 18 of basic_bert_unit/Basic_Bert_Unit_model.py to x = self.bert_model(input_ids = batch_word_list,attention_mask = attention_mask, return_dict = False)
  • change the line 18 of interaction_model/Basic_Bert_Unit_model.py to x = self.bert_model(input_ids = batch_word_list,attention_mask = attention_mask, return_dict = False)
  • change the line 23 of interaction_model/get_attributeValue_embedding.py to token_ids = Tokenizer.encode(v,truncation = True,add_special_tokens=True,max_length=max_length)

If you have any questions, please feel free to contact me.

from bert-int.

Related Issues (17)

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.