Skip to content

Instantly share code, notes, and snippets.

View lucifermorningstar1305's full-sized avatar
πŸ‘¨β€πŸ’»
Always Coding

Adityam Ghosh lucifermorningstar1305

πŸ‘¨β€πŸ’»
Always Coding
View GitHub Profile
@srcecde
srcecde / reciprocal_rank_fusion_impl.py
Created December 18, 2023 21:45
Reciprocal Rank Fusion implementation
from collections import defaultdict
def reciprocal_rank_fusion(*list_of_list_ranks_system, K=60):
"""
Fuse rank from multiple IR systems using Reciprocal Rank Fusion.
Args:
* list_of_list_ranks_system: Ranked results from different IR system.
K (int): A constant used in the RRF formula (default is 60).
@ferrine
ferrine / network_builder.py
Last active September 28, 2024 18:48
Pytorch models from yaml files
import torch.nn
import collections
class Builder(object):
def __init__(self, *namespaces):
self._namespace = collections.ChainMap(*namespaces)
def __call__(self, name, *args, **kwargs):
try:
return self._namespace[name](*args, **kwargs)