protocol

package
v0.0.0-...-e506182 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASRConfig

type ASRConfig struct {
	URL          string `json:"url"`
	Lang         string `json:"lang"`
	Encoding     string `json:"encoding"`
	SampleRate   int    `json:"sample_rate"`
	ChannelCount int    `json:"channels"`
}

type ASROutput

type ASROutput struct {
	Chunks []ASROutputChunk
}

type ASROutputChunk

type ASROutputChunk struct {
	Chunk
	Text string `json:"text"`
}

ASR

type ASRRequest

type ASRRequest struct {
	SubProj string `json:"sub_proj"`
	PageID  string `json:"page_id"`
	Lang    string `json:"lang"`
	Chunk   Chunk  `json:"chunk"`
	UUID    string `json:"uuid"`
}

type ASRResponse

type ASRResponse struct {
	//PageID string `json:"page_id"`
	UUID string `json:"uuid"`
	Text string `json:"text"`
}

type AnnotationPayload

type AnnotationPayload struct {
	SubProj       string       `json:"sub_proj"`
	Page          PagePayload  `json:"page,omitempty"`
	Chunks        []TransChunk `json:"chunks"`
	Labels        []string     `json:"labels,omitempty"`
	CurrentStatus Status       `json:"current_status,omitempty"`
	StatusHistory []Status     `json:"status_history,omitempty"`
	Comment       string       `json:"comment,omitempty"`
	Index         int64        `json:"index,omitempty"`
}

type AnnotationWithAudioData

type AnnotationWithAudioData struct {
	AnnotationPayload
	Chunk
	// Base64Audio is a base64 string representation of the audio
	Base64Audio string `json:"base64audio,omitempty"`
	FileType    string `json:"file_type"`
	Offset      int64  `json:"offset"`
}

func (AnnotationWithAudioData) PrettyMarshal

func (aa AnnotationWithAudioData) PrettyMarshal() ([]byte, error)

type Chunk

type Chunk struct {
	// Start time in milliseconds
	Start int64 `json:"start"`
	// End time in milliseconds
	End int64 `json:"end"`
}

type ListFiles

type ListFiles struct {
	SubProj string `json:"sub_proj"`
}

type MatchingPage

type MatchingPage struct {
	MatchingChunks []int             `json:"matching_chunks"`
	Page           AnnotationPayload `json:"page"`
}

type PagePayload

type PagePayload struct {
	Chunk
	ID    string `json:"id"`
	Audio string `json:"audio"`
}

type QueryPayload

type QueryPayload struct {
	//ClientID     string       `json:"client_id"`
	//UserName     string       `json:"user_name"`
	Request      QueryRequest `json:"request"`
	StepSize     int64        `json:"step_size"`
	RequestIndex string       `json:"request_index"`
	CurrID       string       `json:"curr_id"`
	Context      int64        `json:"context,omitempty"`
}

QueryPayload holds criteria used to search in the database

type QueryRequest

type QueryRequest struct {
	PageStatus      string   `json:"page_status,omitempty"`
	Status          string   `json:"status,omitempty"`
	AudioFile       string   `json:"audio_file,omitempty"`
	Source          string   `json:"source,omitempty"`
	TransRE         string   `json:"trans_re,omitempty"`
	ValidationIssue ValIssue `json:"validation_issue,omitempty"`
}

type QueryResult

type QueryResult struct {
	MatchingPages []MatchingPage `json:"matching_pages"`
}

type SplitRequestPayload

type SplitRequestPayload struct {
	Audio string `json:"audio"`
	// LeftContext in milliseconds
	LeftContext int64 `json:"left_context"`
	// RightContext in milliseconds
	RightContext int64 `json:"right_context"`
	Chunk        Chunk `json:"chunk"`
}

type Status

type Status struct {
	Name      string `json:"name"`
	Source    string `json:"source"`
	Timestamp string `json:"timestamp"`
}

type TransChunk

type TransChunk struct {
	UUID string `json:"uuid"`
	Chunk
	Trans         string   `json:"trans"`          //`json:"trans,omitempty"`
	CurrentStatus Status   `json:"current_status"` //`json:"current_status,omitempty"`
	StatusHistory []Status `json:"status_history"` //`json:"status_history,omitempty"`
}

type UnlockPayload

type UnlockPayload struct {
	SubProj string `json:"sub_proj"`
	PageID  string `json:"page_id"`
}

type ValIssue

type ValIssue struct {
	HasIssue  bool     `json:"has_issue"`
	RuleNames []string `json:"rule_names"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL