Comments (7)
Hi @kingafy, GPL needs only a corpus.jsonl file (data sample is here) for minimal running.
Specifically, you need three steps:
- Prepare your corpus in the same format as this data sample mentioned above;
- Put your corpus.jsonl under a folder, e.g. named as "generated" for data loading and data generation by GPL;
- Call gpl.train with the folder path as an input argument:
python -m gpl.train \
--path_to_generated_data "generated" \
--output_dir "output"
I will include more explanations about this in the readme in the future.
from gpl.
I get this error:
File "train.py", line 9, in <module>
queries_per_passage=-1)
File "E:\Data_Science\virtual_envs\py36\lib\site-packages\gpl\train.py", line 124, in train
corpus, gen_queries, gen_qrels = GenericDataLoader(path_to_generated_data).load(split="train")
File "E:\Data_Science\virtual_envs\py36\lib\site-packages\beir\datasets\data_loader.py", line 63, in load
self.check(fIn=self.query_file, ext="jsonl")
File "E:\Data_Science\virtual_envs\py36\lib\site-packages\beir\datasets\data_loader.py", line 30, in check
raise ValueError("File {} not present! Please provide accurate file.".format(fIn))
ValueError: File generated\queries.jsonl not present! Please provide accurate file.
Script:
import gpl
#dataset = 'fiqa'
gpl.train(path_to_generated_data="generated",
output_dir="output",
mnrl_output_dir="output",
mnrl_evaluation_output="output",
new_size=-1,
queries_per_passage=-1)
generated data comes from the suggested example (only corpus.jsonl in the folder).
from gpl.
anyone have any luck?
from gpl.
Hi @christopherfeld, could you please try this toy example: #5 (comment) and let me know whether it is runnable in your case?
from gpl.
No luck. To give some baseline...
I tried your code from April 14, above to no avail. I tried the toy example from the comment above to no avail.
My folder structure looks like this:
- corpus/corpus.jsonl
- generated (empty)
- output (empty)
code (per your request: #5 (comment)):
python -m gpl.train --path_to_generated_data "generated/" --base_ckpt "distilbert-base-uncased" --gpl_score_function "dot" --batch_size_gpl 4 --gpl_steps 100 --new_size 10 --queries_per_passage 1 --output_dir "output/corpus.jsonl" --evaluation_data "corpus" --evaluation_output "evaluation/corpus.jsonl" --generator "BeIR/query-gen-msmarco-t5-base-v1" --retrievers "msmarco-distilbert-base-v3" "msmarco-MiniLM-L-6-v3" --retriever_score_functions "cos_sim" "cos_sim" --cross_encoder "cross-encoder/ms-marco-MiniLM-L-6-v2" --qgen_prefix "qgen"
Thoughts:
Got me thinking that the qgen prefix might be the issue so placed that to "", which still adds a '-'...'. Tried to rerun the code after rename the outputs in the generated folder to remove the qgen and -... then ran into an index error:
from gpl.
Hi @christopherfeld, I have created a google colab notebook showing the running results of the toy example: https://colab.research.google.com/drive/1Wis4WugIvpnSAc7F7HGBkB38lGvNHTtX?usp=sharing Please have a look:).
BTW, I think the error might be due to the export
command does not work on windows (I am not really familiar with windows).
from gpl.
thanks! I ran this on my personal M1 and it works! Now am just waiting on my work Mac to get here :)
from gpl.
Related Issues (20)
- base checkpoint selection HOT 3
- KeyError during pseudo labeling HOT 5
- Version conflict due to `easy-elasticsearch` and latest `beir`
- Website link does not work HOT 2
- Loss function HOT 2
- Support for Azure?
- Multi-lingual GPL HOT 4
- RuntimeError: CUDA out of memory HOT 4
- Evaluation data format HOT 1
- TSDAE to GPL... Error on start HOT 1
- Guidance on gpl_stapes, new_size and batch_size_gpl HOT 1
- GPL for sentence embedding tasks? HOT 4
- Should the leaning domain contain only assertion texts (like "Python is a high-level general-purpose programming language")?
- Can I replace it with codeT5/codebert? HOT 3
- Model not saved HOT 1
- Evaluation every 10k steps HOT 2
- pytrec_eval dependency issue HOT 4
- TSDAE + GPL and TAS-B + GPL HOT 10
- GPU speedup HOT 1
- Training on multi gpu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpl.