Giter Club home page Giter Club logo

ance-tele's Introduction

OpenMatch v2

An all-in-one toolkit for information retrieval. Under active development.

Install

git clone https://github.com/OpenMatch/OpenMatch.git
cd OpenMatch
pip install -e .

-e means editable, i.e. you can change the code directly in your directory.

We do not include all the requirements in the package. You may need to manually install torch, tensorboard.

You may also need faiss for dense retrieval. You can install either faiss-cpu or faiss-gpu, according to your enviroment. Note that if you want to perform search on GPUs, you need to install the version of faiss-gpu compatible with your CUDA. In some cases (usually CUDA >= 11.0) pip installs a wrong version. If you encounter errors during search on GPUs, you may try installing it from conda.

Features

  • Human-friendly interface for dense retriever and re-ranker training and testing
  • Various PLMs supported (BERT, RoBERTa, T5...)
  • Native support for common IR & QA Datasets (MS MARCO, NQ, KILT, BEIR, ...)
  • Deep integration with Huggingface Transformers and Datasets
  • Efficient training and inference via stream-style data loading

Docs

Documentation Status

We are actively working on the docs.

Project Organizers

  • Zhiyuan Liu
  • Zhenghao Liu
  • Chenyan Xiong
  • Maosong Sun

Acknowledgments

Our implementation uses Tevatron as the starting point. We thank its authors for their contributions.

Contact

Please email to [email protected].

ance-tele's People

Contributors

sunsishining avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

techthiyanes

ance-tele's Issues

ValueError: Trainer: evaluation requires an eval_dataset.

I got this error when trying to run ANCETele with my data.

ValueError: Trainer: evaluation requires an eval_dataset.

When I printed eval_dataset in train_dr.py, None came out. Is this the error that occurred?
My data is a bit small. Is the problem caused by the data being too small?
If the problem arises due to the characteristics of the data, please let me know how to supplement the data.

eval_dataset = train_dataset_cls(
    tokenizer, 
    data_args, 
    is_eval=True, 
    cache_dir=data_args.data_cache_dir or model_args.cache_dir
) if data_args.eval_path is not None else None
print("eval_dataset ", eval_dataset)

eval_dataset None

And I printed queries, positives, and qid in combine_negative.py, and are these three variables shaped as follows?

with open(file_2, "r", encoding="utf-8") as fi,
open(output_file, "w", encoding="utf-8") as fw:
for line in tqdm(fi):
data = json.loads(line)
query = data["query"]
positives = data["positives"]
qid = "_".join(str(ids) for ids in query)
print("query")
print(query)
print("positives")
print(positives)
print("qid")
print(qid)

query
[20808, 23500, 1498, 4373, 2371, 13964, 28059, 2052, 22819, 1513, 2259, 2180, 555, 2227, 2182, 18, 1545, 2116, 3691, 2371, 4000, 3669, 2052, 4049, 2496, 2259, 2332, 18119, 35]
positives
[[17, 2, 3907, 2079, 8936, 23999, 2138, 5418, 2173, 20808, 23500, 2021, 2119, 1537, 3747, 27135, 2079, 10502, 3766, 2259, 7365, 6041, 2069, 4036, 2530]]
qid
20808_23500_1498_4373_2371_13964_28059_2052_22819_1513_2259_2180_555_2227_2182_18_1545_2116_3691_2371_4000_3669_2052_4049_2496_2259_2332_18119_35

In the code below, it only enters "if" and "else" never enters, so diff_num is 0 even after the for statement is over, is this related to the absence of eval_testset?
How should we solve the problem?
if qid in query_data_dict:
print("if qid in query_data_dict:")
f1, offset = query_data_dict[qid]
f1.seek(offset, 0)
data1 = json.loads(f1.readline())
negatives = data["negatives"] + data1["negatives"]
neg_num_list.append(len(negatives))
else:
print("else")
negatives = data["negatives"]
diff_num += 1

Question on Constructing the "Tele-neg" Sets

Hi Sun Si,
Congrats on your amazing job! Both the idea and results are very impressive.

I have one question on how you construct the "Tele-neg" set for each query. From equations (4) (5) (6) of your paper, it seems like you create the new "Tele-neg" set by merging "ANCE-neg", old "Tele-neg", and "lookahead-neg". The sampling coefficient for "ANCE-neg" and "lookahead-neg" are \alpha and \beta, and both of them are equal to 0.5 (the best hyper-parameter you mention in the paper).

But from your code preprocess/combine_marco_negative.py, it seems like you just directly merge two sets without any sampling coefficient. Can I know which part of your code contains the sampling coefficients for "ANCE-neg" and "lookahead-neg"?

Best wishes,
Hansi Zeng

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.