{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Unnamed: 0 | \n",
" COUNTRY_KEY | \n",
" ITEM_DESC | \n",
" BARCODE | \n",
" BEM_CLASS_KEY | \n",
" BEM_CLASS_DESC_FR | \n",
" prediction | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0 | \n",
" FRA | \n",
" 150ML SECHE VERNIS VITRY | \n",
" 3538892526034 | \n",
" 1964 | \n",
" DIVERS MAQUILLAGE | \n",
" maquillage des ongles | \n",
"
\n",
" \n",
" | 1 | \n",
" 1 | \n",
" FRA | \n",
" 15COM.SOMMEIL TRIPLE ACTI.PURE | \n",
" 3701056803443 | \n",
" 1964 | \n",
" DIVERS MAQUILLAGE | \n",
" maquillage | \n",
"
\n",
" \n",
" | 2 | \n",
" 2 | \n",
" FRA | \n",
" 2 EPONG.DEMAQUILLER N°42 SANOD | \n",
" 3701509580426 | \n",
" 1964 | \n",
" DIVERS MAQUILLAGE | \n",
" autres produits maquillage | \n",
"
\n",
" \n",
" | 3 | \n",
" 3 | \n",
" FRA | \n",
" 200ML DIFF PFUM FIGUE CDP | \n",
" 3551780164033 | \n",
" 1964 | \n",
" DIVERS MAQUILLAGE | \n",
" maquillage | \n",
"
\n",
" \n",
" | 4 | \n",
" 4 | \n",
" FRA | \n",
" 2PCS EPONGE DEMAQUILLANTE | \n",
" 3276558220253 | \n",
" 1964 | \n",
" DIVERS MAQUILLAGE | \n",
" autres produits maquillage | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Unnamed: 0 COUNTRY_KEY ITEM_DESC BARCODE \\\n",
"0 0 FRA 150ML SECHE VERNIS VITRY 3538892526034 \n",
"1 1 FRA 15COM.SOMMEIL TRIPLE ACTI.PURE 3701056803443 \n",
"2 2 FRA 2 EPONG.DEMAQUILLER N°42 SANOD 3701509580426 \n",
"3 3 FRA 200ML DIFF PFUM FIGUE CDP 3551780164033 \n",
"4 4 FRA 2PCS EPONGE DEMAQUILLANTE 3276558220253 \n",
"\n",
" BEM_CLASS_KEY BEM_CLASS_DESC_FR prediction \n",
"0 1964 DIVERS MAQUILLAGE maquillage des ongles \n",
"1 1964 DIVERS MAQUILLAGE maquillage \n",
"2 1964 DIVERS MAQUILLAGE autres produits maquillage \n",
"3 1964 DIVERS MAQUILLAGE maquillage \n",
"4 1964 DIVERS MAQUILLAGE autres produits maquillage "
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\"dataset/data_maquillage.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from traning_zone.classe_prediction.prediction_classe import *"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\coulibab\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\util.py:887: UserWarning: [W095] Model 'fr_pipeline' (0.0.0) was trained with spaCy v3.6 and may not be 100% compatible with the current version (3.5.3). If you see errors or degraded performance, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate\n",
" warnings.warn(warn_msg)\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" item_desc | \n",
" classe | \n",
" hyper classe | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" KID KITTY FEMME BETY NAILMATI | \n",
" douches | \n",
" {'Confiserie': 0.10790520906448364, 'Soins Che... | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" item_desc classe \\\n",
"0 KID KITTY FEMME BETY NAILMATI douches \n",
"\n",
" hyper classe \n",
"0 {'Confiserie': 0.10790520906448364, 'Soins Che... "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#X = df.ITEM_DESC\n",
"X = pd.DataFrame({\"X\" : [\"KID KITTY FEMME BETY NAILMATI\"]})\n",
"X = X.X\n",
"pred = PredictionV(X)\n",
"data = pred.prediction(\"spacy_lm\")\n",
"data"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}