<commit_before><commit_msg>Add json data decoder<commit_after>package gothink

import (
    "encoding/json"
    "io/ioutil"
)

type DataSet struct {
    Inputs, Outputs [][]float64
}

func (d *DataSet) Inputs (i int) []float64{
    return d.inputs[i]
}

func (d *DataSet) Outputs (i int) []float64{
    return d.outputs[i]
}

func NewDataSet (filepath string) (*DataSet, error) {
    b, err := ioutil.ReadFile(filepath)
    if err != nil {
        panic(err)
    }

    d := DataSet{}
    return &d, json.Unmarshal(b, &d)
}

{'fraction_non_alphanumeric': 0.1450381679389313, 'fraction_numerical': 0.011450381679389313, 'mean_word_length': 3.2, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3037039', 'n_tokens_mistral': 202, 'n_tokens_neox': 199, 'n_words': 51}