Code Monkey home page Code Monkey logo

repbert-index's Introduction

Hi there 👋 This is Jingtao Zhan.

  • 🌱 I’m a third-year PhD student at Tsinghua IR Group supervised by Prof. Shaoping Ma and Prof. Yiqun Liu.
  • 🔭 My research lies in Information Retrieval and Web Search. I currently focus on Dense Retrieval with a wide interest in improving its effectiveness, efficiency, and interpretability. The publications are available at my homepage.
  • 📫 Contact me via [email protected] or twitter.

repbert-index's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

repbert-index's Issues

Question about model architecture

Hello,

I'm trying to reimplement the model and I found that the situation between train and inference is different.
In the train.py, the model feed the input like format as (query, doc) but in the precompute.py, the model feed input as (query) and (doc) seperately.
According to your paper, embed(query) and embed(doc) is right I think.
Am i miss something?

Thank you

运行环境

请问一下你的基本运行环境是怎么样的,比如torch和transformers的版本?谢谢。

a small bug?!

Hello, I just read the complete code of the RepBERT, and there seems to be a small bug in "train.py". In lines 91 and 93, the "_" is useless, right?

for epoch_idx, _ in enumerate(train_iterator):
  epoch_iterator = tqdm(train_dataloader, desc="Iteration")
    for step, (batch, _, _) in enumerate(epoch_iterator):

我想用这个模型处理一些中文任务

您好,我想用这个模型处理一些中文任务。

我主要是想知道您是如何训练bert的。我手头有一个1m的语料库。

此外,转中文的话我还需要注意哪些问题。

谢谢

Precompute time

Hello,

Thank you for your good work.
How much do you think it takes approximately to precompute all the memmaps for msmarco collection on one RTX-2080- 8GB gpu? It seems it takes several days... I want to make sure I am on the correct path.

a question about the attention mask

Hello, I notice you try to mask the attention between the query and document. However, it seems to be a problem when the input sequence is padded.

def _mask_both_directions(valid_mask, token_type_ids):
    assert valid_mask.dim() == 2
    attention_mask = valid_mask[:, None, :]

    type_attention_mask = torch.abs(token_type_ids[:, :, None] - token_type_ids[:, None, :])
    attention_mask = attention_mask - type_attention_mask
    attention_mask = torch.clamp(attention_mask, 0, None)
    return attention_mask

e.g., if "token_type_ids" equals [0, 0, 0, 1, 1] (without padding),
then the "type_attention_mask" will be
|0 0 0 1 1|
|0 0 0 1 1|
|0 0 0 1 1|
|1 1 1 0 0|
|1 1 1 0 0|
and "attention_mask" will be
|1 1 1 0 0|
|1 1 1 0 0|
|1 1 1 0 0|
|0 0 0 1 1|
|0 0 0 1 1|
it is correct.
However, if "token_type_ids" equals [0, 0, 0, 1, 1, 0] (with padding, max_length=6),
then the "type_attention_mask" will be
|0 0 0 1 1 0|
|0 0 0 1 1 0|
|0 0 0 1 1 0|
|1 1 1 0 0 1|
|1 1 1 0 0 1|
|0 0 0 1 1 0|
and "attention_mask" will be
|1 1 1 0 0 0|
|1 1 1 0 0 0|
|1 1 1 0 0 0|
|0 0 0 1 1 0|
|0 0 0 1 1 0|
|1 1 1 0 0 0|
it is not the expected attention mask, right?

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.