-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mam10eks/qpptk-dev
Qpptk dev
- Loading branch information
Showing
89 changed files
with
7,617 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"image": "mam10eks/qpptk:0.0.2-dev", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "ms-toolsai.jupyter"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Unit Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run tests | ||
working-directory: ./code/qpptk | ||
run: | | ||
mkdir ~/repos/ | ||
pip3 install -r requirements.txt | ||
pytest | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./code", | ||
"-p", | ||
"*test*.py" | ||
], | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestArgs": [ | ||
"code" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
# QPP-EnhancedEval | ||
Code to Reproduce ECIR 2021 paper "An Enhanced Evaluation Framework for Query Performance Prediction" | ||
|
||
|
||
## Run it locally with TIRA | ||
|
||
Please ensure that you have python >= 3.7, Docker, and tira-run installed (`pip3 install tira`). | ||
|
||
``` | ||
tira-run \ | ||
--input-dataset workshop-on-open-web-search/query-processing-20231027-training \ | ||
--input-run 'workshop-on-open-web-search/tira-ir-starter/Index (tira-ir-starter-pyterrier)' \ | ||
--image mam10eks/qpptk:0.0.1 \ | ||
--command 'python3 /qpptk_main.py -ti $inputRun/index/ --jsonl_queries $inputDataset/queries.jsonl --predict --retrieve --output $outputDir --cleanOutput --stats_index_path /tmp' | ||
``` | ||
|
||
File "/workspaces/QPP-EnhancedEval/code/qpptk/qpptk/global_manager.py", line 33, in run_pre_prediction_process | ||
max_idf = process.calc_max_idf() | ||
File "/workspaces/QPP-EnhancedEval/code/qpptk/qpptk/pre_retrieval_predictors.py", line 30, in calc_max_idf | ||
return np.log(np.array(self.total_docs) / self.terms_df).max() | ||
File "/usr/local/lib/python3.10/dist-packages/numpy/core/_methods.py", line 40, in _amax | ||
return umr_maximum(a, axis, None, out, keepdims, initial, where) | ||
ValueError: zero-size array to reduction operation maximum which has no identity | ||
|
||
|
||
## Build the Docker Images | ||
|
||
Build the docker image via: | ||
``` | ||
docker build -f docker/Dockerfile -t mam10eks/qpptk:0.0.1 . | ||
``` | ||
|
||
If you update any dependencies, please rebuild the dev container via: | ||
``` | ||
docker build -f docker/Dockerfile.dev -t mam10eks/qpptk:0.0.1-dev . | ||
``` | ||
|
||
## Upload to TIRA | ||
|
||
``` | ||
docker tag mam10eks/qpptk:0.0.1 registry.webis.de/code-research/tira/tira-user-qpptk/qpptk:0.0.1 | ||
docker push registry.webis.de/code-research/tira/tira-user-qpptk/qpptk:0.0.1 | ||
``` | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
from .utility_functions import * | ||
from .config import * | ||
from .load_text_index import IndexText, parse_posting_list | ||
from .load_ciff_index import IndexCiff, parse_index_file | ||
from .load_db_index import IndexDB | ||
from .parse_queries import QueryParserText, QueryParserCiff | ||
from .load_terrier_index import IndexTerrier | ||
from .parse_queries import QueryParserText, QueryParserCiff, QueryParserJsonl | ||
from .retrieval_local_manager import LocalManagerRetrieval | ||
# from .parse_ciff_queries import QueryParserCiff, parse_ciff_queries_file | ||
from .pre_retrieval_predictors import LocalManagerPredictorPre | ||
from .post_retrieval_predictors import LocalManagerPredictorPost | ||
from .index_to_db import parse_index_to_db | ||
from .qpptk_main import parse_args, main, get_queries_object | ||
from .score_replacement_prediction import replace_scores_in_run_file_with_reference_scores | ||
|
||
__all__ = ['Config', 'Posting', 'TermPosting', 'TermRecord', 'TermFrequency', 'DocRecord', 'ResultPair', 'get_file_len', | ||
'read_line', 'parse_posting_list', 'binary_search', 'IndexText', 'IndexCiff', 'parse_index_file', 'IndexDB', | ||
'QueryParserText', 'QueryParserCiff', 'LocalManagerRetrieval', 'LocalManagerPredictorPre', 'ensure_dir', | ||
'ensure_file', 'LocalManagerPredictorPost', 'read_message', 'plot_roc', | ||
'transform_list_to_counts_dict', 'jaccard_similarity', 'overlap_coefficient', | ||
'set_index_dump_paths', 'add_topic_to_qdf', 'msgpack_encode', 'msgpack_decode', | ||
'parse_index_to_db', 'read_trec_res_file'] | ||
'read_line', 'parse_posting_list', 'binary_search', 'IndexText', 'IndexDB', 'IndexTerrier', | ||
'QueryParserText', 'QueryParserCiff', 'QueryParserJsonl', 'LocalManagerRetrieval', | ||
'LocalManagerPredictorPre', 'ensure_dir', 'ensure_file', 'LocalManagerPredictorPost', 'read_message', | ||
'plot_roc', 'transform_list_to_counts_dict', 'jaccard_similarity', 'overlap_coefficient', | ||
'sorensen_dice_similarity', 'calc_ndcg', 'set_index_dump_paths', 'add_topic_to_qdf', 'msgpack_encode', | ||
'msgpack_decode', 'read_trec_res_file', 'parse_args', 'main', 'get_queries_object', | ||
'replace_scores_in_run_file_with_reference_scores'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.