All Projects → novalagung → go-eek

novalagung / go-eek

Licence: MIT license
Blazingly fast and safe Go evaluation library, created on top of Go pkg/plugin package

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-eek

CrowdTruth
Version 1.0 of the CrowdTruth Framework for crowdsourcing ground truth data, for training and evaluation of cognitive computing systems. Check out also version 2.0 at https://github.com/CrowdTruth/CrowdTruth-core. Data collected with CrowdTruth methodology: http://data.crowdtruth.org/. Our papers: http://crowdtruth.org/papers/
Stars: ✭ 62 (+67.57%)
Mutual labels:  evaluation
naacl2018-fever
Fact Extraction and VERification baseline published in NAACL2018
Stars: ✭ 109 (+194.59%)
Mutual labels:  evaluation
DiscEval
Discourse Based Evaluation of Language Understanding
Stars: ✭ 18 (-51.35%)
Mutual labels:  evaluation
naeval
Comparing quality and performance of NLP systems for Russian language
Stars: ✭ 38 (+2.7%)
Mutual labels:  evaluation
hydrotools
Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data.
Stars: ✭ 36 (-2.7%)
Mutual labels:  evaluation
speech-recognition-evaluation
Evaluate results from ASR/Speech-to-Text quickly
Stars: ✭ 25 (-32.43%)
Mutual labels:  evaluation
Automatic speech recognition
End-to-end Automatic Speech Recognition for Madarian and English in Tensorflow
Stars: ✭ 2,751 (+7335.14%)
Mutual labels:  evaluation
audio degrader
Audio degradation toolbox in python, with a command-line tool. It is useful to apply controlled degradations to audio: e.g. data augmentation, evaluation in noisy conditions, etc.
Stars: ✭ 40 (+8.11%)
Mutual labels:  evaluation
embedding evaluation
Evaluate your word embeddings
Stars: ✭ 32 (-13.51%)
Mutual labels:  evaluation
verif
Software for verifying weather forecasts
Stars: ✭ 70 (+89.19%)
Mutual labels:  evaluation
precision-recall-distributions
Assessing Generative Models via Precision and Recall (official repository)
Stars: ✭ 80 (+116.22%)
Mutual labels:  evaluation
contextual
Contextual Bandits in R - simulation and evaluation of Multi-Armed Bandit Policies
Stars: ✭ 72 (+94.59%)
Mutual labels:  evaluation
vcf stuff
📊Evaluating, filtering, comparing, and visualising VCF
Stars: ✭ 19 (-48.65%)
Mutual labels:  evaluation
tg2019task
TextGraphs-13 Shared Task on Multi-Hop Inference Explanation Regeneration
Stars: ✭ 42 (+13.51%)
Mutual labels:  evaluation
cyberrating
🚥 S&P of Blockchains
Stars: ✭ 13 (-64.86%)
Mutual labels:  evaluation
meval-rs
Math expression parser and evaluation library for Rust
Stars: ✭ 118 (+218.92%)
Mutual labels:  evaluation
WebAudioEvaluationTool
A tool based on the HTML5 Web Audio API to perform perceptual audio evaluation tests locally or on remote machines over the web.
Stars: ✭ 101 (+172.97%)
Mutual labels:  evaluation
texpr
Boolean evaluation and digital calculation expression engine for GO
Stars: ✭ 18 (-51.35%)
Mutual labels:  evaluation
word-benchmarks
Benchmarks for intrinsic word embeddings evaluation.
Stars: ✭ 45 (+21.62%)
Mutual labels:  evaluation
evaluator
No description or website provided.
Stars: ✭ 35 (-5.41%)
Mutual labels:  evaluation

go-eek

Blazingly fast and safe go evaluation library, created on top of Go pkg/plugin package.

Go Report Card Build Status Coverage Status

On go-eek, the eval expression is encapsulated into a single function, and stored in a go file. The go file later on will be build into a plugin file (*.so file). And then next, for every evaluation call, it will happen in the plugin file. This is why go-eek is insanely fast.

go-eek accept standar Go syntax expression.

Example

Simple Example

import . "github.com/novalagung/go-eek"

// create new eek object and name it
obj := New()
obj.SetName("simple operation")

// define variables (and default value of particular variable if available)
obj.DefineVariable(Var{Name: "VarA", Type: "int"})
obj.DefineVariable(Var{Name: "VarB", Type: "float64", DefaultValue: 10.5})

// specify the evaluation expression in go standard syntax
obj.PrepareEvaluation(`
    castedVarA := float64(VarA)
    VarC := castedVarA + VarB
    return VarC
`)

// build only need to happen once
err := obj.Build()
if err != nil {
    log.Fatal(err)
}

// evaluate!
output1, _ := obj.Evaluate(ExecVar{ "VarA": 9 })
fmt.Println("with VarA = 9, the result will be", output1)
output2, _ := obj.Evaluate(ExecVar{ "VarA": 12, "VarB": 12.4 })
fmt.Println("with VarA = 12 and VarB = 12.4, the result will be", output2)

More Complex Example

obj := eek.New("evaluation with 3rd party library")

obj.ImportPackage("fmt")
obj.ImportPackage("github.com/novalagung/gubrak")

obj.DefineVariable(eek.Var{Name: "VarMessageWin", Type: "string", DefaultValue: "Congrats! You win the lottery!"})
obj.DefineVariable(eek.Var{Name: "VarMessageLose", Type: "string", DefaultValue: "You lose"})
obj.DefineVariable(eek.Var{Name: "VarYourLotteryCode", Type: "int"})
obj.DefineVariable(eek.Var{Name: "VarRepeatUntil", Type: "int", DefaultValue: 5})

obj.PrepareEvaluation(`
    generateRandomNumber := func() int {
        return gubrak.RandomInt(0, 10)
    }

    i := 0
    for i < VarRepeatUntil {
        if generateRandomNumber() == VarYourLotteryCode {
            return fmt.Sprintf("%s after %d tried", VarMessageWin, i + 1)
        }

        i++
    }
    
    return VarMessageLose
`)

err := obj.Build()
if err != nil {
    log.Fatal(err)
}

output, _ = obj.Evaluate(eek.ExecVar{
    "VarYourLotteryCode": 3,
    "VarRepeatUntil":     10,
})
fmt.Println("output:", output)

Arithmethic expression Example

obj := New("aritmethic expressions")
obj.DefineVariable(eek.Var{Name: "VarN", Type: "int"})
obj.DefineFunction(eek.Func{
    Name: "IF",
    BodyFunction: `
        func(cond bool, ok, nok string) string {
            if cond {
                return ok
            } else {
                return nok
            }
        }
    `,
})
obj.DefineFunction(eek.Func{
    Name: "OR",
    BodyFunction: `
        func(cond1, cond2 bool) bool {
            return cond1 || cond2
        }
    `,
})
obj.DefineFunction(eek.Func{
    Name:         "NOT",
    BodyFunction: `func(cond bool) bool { return !cond }`,
})
obj.PrepareEvaluation(`
    result := IF(VarN>20,IF(OR(VarN>40,N==40),IF(VarN>60,IF(NOT(VarN>80),"good",IF(VarN==90,"perfect","terrific")),"ok"),"ok, but still bad"),"bad")
    
    return result
`)

err := obj.Build()
if err != nil {
    log.Fatal(err)
}

output, _ := obj.Evaluate(eek.ExecVar{"VarN": 76})
fmt.Println(output)

More example available on the *_test.go file.

Documentation

Godoc documentation

Author

Noval Agung Prayog

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].