Views
No views yet
Ocean-Buoy-Log-Captioner is a Vision-Encoder-Decoder model designed for multimodal log analysis. It is specifically trained to generate descriptive text summaries (captions) of environmental events by jointly processing structured sensor readings (input features) and a short event code/description.visual_observation text and event_description from the log.VisionEncoderDecoderModel).timestamp, temperature_c, event_code, etc.) into a contextual vector.[T:14.5] [S:35.2] [pH:8.1] [CODE:P_OK]).[T:VALUE]). Any deviation in the input format will lead to poor generation quality.1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3model_name = "Multimodal/Ocean-Buoy-Log-Captioner"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
6
7# Structured data represented as a tokenizable string following the training format
8# T=Temperature, S=Salinity, pH=pH Level, CODE=Event Code
9structured_log = "[T:14.0] [S:35.5] [pH:7.7] [CODE:A_LOW] [EVENT:Low pH reading]"
10
11# Encode the structured log using the encoder tokenizer
12input_ids = tokenizer.encode(structured_log, return_tensors="pt")
13
14# Generate the descriptive text summary
15output_ids = model.generate(
16 input_ids,
17 max_length=50,
18 num_beams=4,
19 early_stopping=True
20)
21
22# Decode the generated text
23caption = tokenizer.decode(output_ids[0], skip_special_tokens=True)
24
25print(f"Structured Log Input: {structured_log}")
26print(f"Generated Log Caption: {caption}")
27# Expected output (approx): Water color is slightly turbid, suggesting sediment runoff or upwelling. Low pH reading detected.