ml

package
v0.0.0-...-628cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 7

README

SelfDoc

Auto-generated code documentation to make the repository easier to navigate and contribute to.

Last Updated: 2023-05-15

The ml directory is for machine learning functionality related to recruiting emails and job postings. It includes a package with a client struct for classifying and parsing these documents, as well as a test file with unit tests for various methods in the package.

Files

ml.go

This file defines the ML package, which includes a client struct with methods for classifying and parsing recruiting emails and job postings. The client struct also includes a NewService function for creating a new client and uses HTTP requests to communicate with the SRC API.

ml_test.go

This file contains unit tests for various methods in the ml package, including ServiceClassify, BatchClassify, and ParseJob. The tests create mock servers and verify that the functions correctly send HTTP requests and return expected responses.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(ctx context.Context, arg NewServiceArg) *client

Types

type BatchClassifyRequest

type BatchClassifyRequest struct {
	Inputs map[string]*ClassifyRequest `json:"inputs"`
}

type BatchClassifyResponse

type BatchClassifyResponse struct {
	Results map[string]bool `json:"results"`
}

type BatchParseJobRequest

type BatchParseJobRequest struct {
	Inputs map[string]*BatchParseJobRequest `json:"inputs"`
}

type BatchParseJobResponse

type BatchParseJobResponse struct {
	Results map[string]*ParseJobResponse `json:"results"`
}

type ClassifyRequest

type ClassifyRequest = EmailInput

type ClassifyResponse

type ClassifyResponse struct {
	Result bool `json:"result"`
}

type EmailInput

type EmailInput struct {
	From    string `json:"from"`
	Subject string `json:"subject"`
	Body    string `json:"body"`
}

type NewServiceArg

type NewServiceArg struct {
	BaseURL   string
	AuthToken string
}

type ParseJobRequest

type ParseJobRequest = EmailInput

type ParseJobResponse

type ParseJobResponse struct {
	Company   string `json:"company_name"`
	Title     string `json:"job_title"`
	Recruiter string `json:"recruiter_name"`
}

type Service

type Service interface {
	// Classify if the input is a recruiting email or not
	Classify(input *ClassifyRequest) (*ClassifyResponse, error)
	// Classify if the inputs recruiting emails or not
	BatchClassify(inputs *BatchClassifyRequest) (*BatchClassifyResponse, error)
	// Parse if the input meets the classification
	ParseJob(input *ParseJobRequest) (*ParseJobResponse, error)
	// Parse if the inputs are spam or not
	BatchParseJob(req *BatchParseJobRequest) (*BatchParseJobResponse, error)
}

Jump to

Keyboard shortcuts

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