Skip to content

Instantly share code, notes, and snippets.

View daveebbelaar's full-sized avatar

Dave Ebbelaar daveebbelaar

View GitHub Profile
import optuna
import xgboost as xgb
from sklearn.metrics import mean_squared_error # or any other metric
from sklearn.model_selection import train_test_split
# Load the dataset
X, y = ... # load your own
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Define the objective function for Optuna
# --------------------------------------------------------------
# Customer Support Ticket Classification System
# --------------------------------------------------------------
import instructor
from pydantic import BaseModel, Field
from openai import OpenAI
from enum import Enum
from typing import List
@daveebbelaar
daveebbelaar / document_intelligence.py
Created July 13, 2024 07:08
A service class for interacting with Azure Document Intelligence API.
import logging
import requests
import time
from typing import Union, Dict
from config.settings import get_settings
class DocumentIntelligenceService:
"""
A service class for interacting with Azure Document Intelligence API.