加载中…
加载中…
TimesJev lets a System 1 model, Decider, answer time series questions in a single forward pass. A small encoder passes a compact representation of each series to the frozen Decider.
Code: https://github.com/coenliu/TimesJev
[4.0, 6.0, 1.0]The encoders are in decider-2b/<dataset>/ and decider-4b/<dataset>/:
<dataset> |
Questions | Answer |
|---|---|---|
env, aiops, health, web |
anomaly detection: Environment, AIOps, Healthcare, Web | normal or anomaly |
cls |
human activity recognition from X, Y, Z acceleration | one of 6 activities |
mcq |
multiple-choice questions | one of the options |
tf |
true/false questions | true or false |
Download this repository and install the dependencies (install the PyTorch build that matches your CUDA version first):
pip install huggingface_hub
hf download Coenliu62/TimesJev --local-dir TimesJev && cd TimesJev
pip install -r requirements.txt
An anomaly detection question from the TSQA Web test set (its TSQA answer is B):
from timesjev_decider import TimesJevDecider
model = TimesJevDecider.from_pretrained("decider-2b/web")
out = model.predict(
context="This dataset includes data from Yahoo's servers and various service metrics, allowing us to assess the "
"operational status of the related equipment based on the information provided. The input Time Serie is "
"[4.0, 6.0, 1.0, 8.0, 1.0, 7.0, 8.0, 3.0].",
question="Are there anomalies in this time series?",
options={"A": "Normal: the series contains only normal points", "B": "Anomaly: the series contains anomaly points"},
)
print(out) # {"answer": <letter>, "probs": {"A": ..., "B": ...}}
python timesjev_decider.py --encoder decider-2b/mcq --input examples/questions.jsonl
Each line of the file is one question: {"id": ..., "context": ..., "question": ..., "options": {"A": ..., ...}}.
The script prints the chosen option and the probability of every option for each question.
Each encoder was trained on training questions of one TSQA dataset for 3 epochs (Decider-4B: 6 epochs for env,
aiops, web, cls and mcq) with learning rate 1e-3, while Decider stayed frozen. The full setup, including how the
features were chosen, is in the GitHub repository.
Apache-2.0, the same as TSQA and Decider.
Mapika/decider-2b