FlagOpen / FlagEmbedding

Retrieval and Retrieval-augmented LLMs
MIT License
6.13k stars 441 forks source link

使用dense_retrieval时,在search result时遇到JavaVersionError #678

Open zeruiz99 opened 3 months ago

zeruiz99 commented 3 months ago

CentOS系统Linux,使用conda去装了下openjdk-11-jdk 使用conda install conda-forge/label/gcc7::openjdk去安装openjdk java -version: openjdk version "11.0.1" 2018-10-16 LTS OpenJDK Runtime Environment Zulu11.2+3 (build 11.0.1+13-LTS) JVM exception occurred: io/anserini/eval/Qrels has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 55.0 java.lang.UnsupportedClassVersionError 当我装到java version是8的时候就对应52,就给我报: jnius.JavaException: JVM exception occurred: org/apache/lucene/search/Query has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 java.lang.UnsupportedClassVersionError

按道理来说装到11应该满足要求了,但是报错直接到65了

zeruiz99 commented 3 months ago

可能需要把openjdk的包官网说明更新一下,我去https://jdk.java.net上下载了一下新的可以用了

hanhainebula commented 3 months ago

是的,pyserini 最新的版本可能需要安装 openjdk-21-jdk 才能正常使用

zeruiz99 commented 3 months ago

是的,pyserini 最新的版本可能需要安装 openjdk-21-jdk 才能正常使用

想问下,我在用evaluate的过程中,先执行的对bge-m3的dense retrieval的评估,然后pooling_method不管选mean还是cls,recall20 100的分数都是0.0,非常奇怪,参数没有修改,但是用了自己的qa数据集

1. Generate Corpus Embedding

python step0-generate_embedding.py --encoder /bge-m3 --index_save_dir /step1 --max_passage_length 512 --batch_size 256 --fp16 --pooling_method cls --normalize_embeddings True

2. Search Results

python step1-search_results.py --encoder /bge-m3 --languages zh_cn --index_save_dir /step1 --result_save_dir /result --qa_data_dir /qa--threads 16 --batch_size 32 --hits 1000 --pooling_method mean --normalize_embeddings True --add_instruction False

3. Print and Save Evaluation Results

python step2-eval_dense_mkqa.py --encoder /bge-m3 --languages zh_cn --search_result_save_dir /result --qa_data_dir qa --eval_result_save_dir /evalresult --metrics recall@20 recall@100 --threads 32 --pooling_method mean --normalize_embeddings True 第二次试mean的时候忘记把第一步的也改成mean了,但是三个都是cls的时候是直接0.0 我的数据集有1760条,有些回答是重复的,因为是单个长回答对应的几个问题,我就拆分放在不同行单独放开了,很奇怪为什么是0.0,按道理数据集小应该也不至于到0.0?

zeruiz99 commented 3 months ago

是不是eval对answers里长度超过100的以后就没法使用了?

zeruiz99 commented 3 months ago

是不是我的问答对里面回答直接是最早放给step0里去embedding的行列目标所导致的