intergo

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2019 License: MIT Imports: 0 Imported by: 0

README

intergo

CircleCI MIT License

A package for interleaving / multileaving ranking generation in go

It is mainly tailored to be used for generating interleaved or multileaved ranking based on the following algorithm

  • Balanced Interleaving/Multileaving (in github.com/mathetake/itergo/bm package)
  • Optimized Multileaving (in github.com/mathetake/intergo/om package)
  • Team Draft Interleaving/Multileaving (in github.com/mathetake/itergo/tdm package)

NOTE: this package aims only at generating a single combined ranking and does not implement the evaluation functions of the given rankings.

How to use

Note that all of your ranking satisfy the intergo.Ranking interface

type Ranking interface {
	GetIDByIndex(int) interface{}
	Len() int
}

which is used for removing duplications in the list.

Anyway, the following example is self-explanatory:

package main

import (
	"fmt"

	"github.com/mathetake/intergo"
	"github.com/mathetake/intergo/tdm"
)

type tRanking []int

func (rk tRanking) GetIDByIndex(i int) interface{} {
	return rk[i]
}

func (rk tRanking) Len() int {
	return len(rk)
}

var _ intergo.Ranking = tRanking{}

func main() {
	TDM := &tdm.TeamDraftMultileaving{}
	rankingA := tRanking{1, 2, 3, 4, 5,}
	rankingB := tRanking{10, 20, 30, 40, 50}

	idxToRk := map[int]tRanking{
		0: rankingA,
		1: rankingB,
	}

	res, _ := TDM.GetInterleavedRanking(4, rankingA, rankingB)
	iRanking := tRanking{}
	for _, it := range res {
		iRanking = append(iRanking, idxToRk[it.RankingIDx][it.ItemIDx])
	}

	fmt.Println("Result: ", iRanking)
}

References

  1. Radlinski, Filip, Madhu Kurup, and Thorsten Joachims. "How does clickthrough data reflect retrieval quality?." Proceedings of the 17th ACM conference on Information and knowledge management. ACM, 2008.

  2. Schuth, Anne, et al. "Multileaved comparisons for fast online evaluation." Proceedings of the 23rd ACM International Conference on Conference on Information and Knowledge Management. ACM, 2014.

  3. Manabe, Tomohiro, et al. "A comparative live evaluation of multileaving methods on a commercial cqa search." Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval. ACM, 2017.

license

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interleaving

type Interleaving interface {
	GetInterleavedRanking(int, ...Ranking) ([]Res, error)
}

type Ranking

type Ranking interface {
	// GetIDByIndex ... allow algorithms to access items' identifier
	GetIDByIndex(int) interface{}

	// Len ... to get the "length" of the ranking
	Len() int
}

type Res

type Res struct {
	// Ranking ... represents to which ranking the item belongs
	RankingIDx int

	// ItemIDx ... represents the item's index in the ranking declared by RankingIDx
	ItemIDx int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL