allenai / allenai/tango

Accessing components of a step result

Aberta
#485 4 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
572
Forks
55
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Suppose I'm working on a POS tagger. I have two steps, one where I load my dataset and another where I train my model:

```jsonnet
{
data: { ... },
trained_model: {
type: "torch::train",
model: {
...
tag_count: ... // what here?
}
...
}
```

I want to count the number of unique tags that were loaded in the dataset dynamically instead of hardcoding the tag count in the config, and I could do this during the `data` step and include it in the output. However, I don't see how a ref like `{ type: "ref", ref: "data" }` could help, since I really want to access a specific subpart of the `data` step's result, e.g. the attribute `tag_count`.

One workaround is to make a third step between the two, `count_tags`, which takes `data` and produces the `tag_count` as its step result, though this gets awkward when you want to do this for many vocabularies.

Does Tango have any amenities for cases like this? It'd be great if I could write something like `{ type: "ref", ref: "data", attrs: ["tag_count"] }`

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.