-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
62 lines (54 loc) · 2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File : main.py
# Description : launch the main application
#
# Libraries requirements :
# <os> : standard library
# - Provides a portable way of using operating system dependent functionality.
# <sys> : standard library
# - provides access to some variables used or maintained by the interpreter and
# to functions that interact strongly with the interpreter.
# <json> : standard library
# - Provides functionalites for data storing and serialization
# <nltk> : standard library
# - Provides comprehesive natural language toolkit, with models and training data in multiples languages
# <torch> : standard library
# - Provides multidimensional arrays and linear algebra tools, optimized for speed
# <numpy> : standard library
# - Provides multidimensional arrays and linear algebra tools, optimized for speed
#
# Revisions:
# Afondiel | 09.12.2020 | Creation
# Afondiel | 11.10.2023 | Last modification
import os
import sys
import json
import nltk
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from src.module.chat_launch import chat_start
from src.module.data_processing import nlp_functions
from src.module.chatclassifier.data_collection import data_prep
from src.module.chatclassifier.chat_dataset import ChatDataset
from src.module.chatclassifier.chat_model import ChatNeuralNet
from src.module.chatclassifier.chat_classifier import ChatClassifier
"""
Main : This file is the main module
"""
# include file access outside src package
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
if __name__ == '__main__' :
# starting the app
print("starting the Chat")
""" PRE TRAINING THE MODEL
# create chat classifier object
# chatclassifier = ChatClassifier()
# training the model
# chatclassifier.execute()
# save the model to a file
# chatclassifier.save_model()
"""
# launching the chat
chat_start()
# leaving the Chat
print("leaving the Chat...")