# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: venv_oecdflows
#     language: python
#     name: venv_oecdflows
# ---

# # Working on Model

import torch
import torch.nn as nn

import pandas as pd
import numpy as np
import os

# # Approach Based on the Following

# +
# https://github.com/AndriyMulyar/bert_document_classification
# -

# ### Unfortunately as shown in the following lines, this repo has problems!!!!

from bert_document_classification.models import SmokerPhenotypingBert

from bert_document_classification.models import ObesityPhenotypingBert

smoking_classifier = SmokerPhenotypingBert(device='cuda', batch_size=10) #defaults to GPU prediction|

# +

smoking_classifier = SmokerPhenotypingBert(device='cpu', batch_size=10) #defaults to GPU prediction
# -

obesity_classifier = ObesityPhenotypingBert(device='cpu', batch_size=10) #or CPU if you would like.

smoking_classifier.predict(["I'm a document! Make me long and the model can still perform well!"])



StarcoderdataJupyterScriptsDedupFiltered