trecrun

package module
v0.0.0-...-cfdb0f1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 5 Imported by: 0

README

trecrun

GoDoc Go Report Card

go get github.com/hscells/trecrun

trecrun deals with the deserialization of output from trec_eval-style run files. This package is inspired by the companion go library https://github.com/TimothyJones/trecresults.

Usage

rf, err := trecrun.RunsFromReader(f)
if err != nil {
    log.Fatal(err)
}

// p@5 for topic 1.
fmt.Println(rf.Runs[1].Measurement["P_5"])

// p@5 for all.
fmt.Println(rf.Measurement["P_5"])

Documentation

Overview

Package trecrun deals with the deserialization of output from trec_eval-style run files. This package is inspired by the companion go library https://github.com/TimothyJones/trecresults.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	RunId       string
	Measurement map[string]float64
}

Result is the summary of the runs.

func NewResult

func NewResult() *Result

NewResult creates a new result.

func (*Result) Add

func (r *Result) Add(measurement string, value float64)

Add adds a measurement and its associated value to the results.

type Run

type Run struct {
	Topic       int64
	Measurement map[string]float64
}

Run is the measurements computed for a topic.

func NewRun

func NewRun(topic int64) *Run

NewRun creates a new run with a topic.

func (*Run) Add

func (r *Run) Add(measurement string, value float64)

Add adds a measurement and its associated value to the run.

type RunFile

type RunFile struct {
	Runs
	Result
}

RunFile is the union of runs and a result.

func RunsFromReader

func RunsFromReader(reader io.Reader) (rf RunFile, err error)

RunsFromReader creates a run file (the runs and result summary) from a reader.

type Runs

type Runs map[int64]Run

Runs are the measurements completed for an experiment.

Jump to

Keyboard shortcuts

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