Partha11 commited on
Commit
ae2ef1b
·
1 Parent(s): 0b01c5f

added project files from private repo

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. app.py +8 -0
  2. definitions.py +3 -0
  3. requirements.txt +5 -0
  4. src/__pycache__/definitions.cpython-39.pyc +0 -0
  5. src/__pycache__/main.cpython-39.pyc +0 -0
  6. src/constants/__init__.py +0 -0
  7. src/main.py +71 -0
  8. src/models/__pycache__/request.cpython-39.pyc +0 -0
  9. src/models/request.py +7 -0
  10. src/processors/__init__.py +0 -0
  11. src/processors/__pycache__/__init__.cpython-39.pyc +0 -0
  12. src/processors/dialog/__init__.py +0 -0
  13. src/processors/dialog/__pycache__/__init__.cpython-39.pyc +0 -0
  14. src/processors/dialog/__pycache__/dialog_management.cpython-39.pyc +0 -0
  15. src/processors/dialog/dialog_management.py +161 -0
  16. src/processors/downloader/__init__.py +0 -0
  17. src/processors/downloader/__pycache__/__init__.cpython-39.pyc +0 -0
  18. src/processors/downloader/__pycache__/model_downloader.cpython-39.pyc +0 -0
  19. src/processors/downloader/model_downloader.py +11 -0
  20. src/processors/nlp/__pycache__/natural_language_generation.cpython-39.pyc +0 -0
  21. src/processors/nlp/__pycache__/natural_language_processing.cpython-39.pyc +0 -0
  22. src/processors/nlp/__pycache__/natural_language_understanding.cpython-39.pyc +0 -0
  23. src/processors/nlp/natural_language_generation.py +26 -0
  24. src/processors/nlp/natural_language_processing.py +21 -0
  25. src/processors/nlp/natural_language_understanding.py +107 -0
  26. src/server/__init__.py +0 -0
  27. src/server/__pycache__/__init__.cpython-39.pyc +0 -0
  28. src/server/router.py +1 -0
  29. src/server/routers/__pycache__/users.cpython-39.pyc +0 -0
  30. src/server/routers/auth.py +0 -0
  31. src/server/routers/users.py +20 -0
  32. src/server/routes.py +21 -0
  33. src/utils/__init__.py +0 -0
  34. src/utils/__pycache__/__init__.cpython-39.pyc +0 -0
  35. src/utils/__pycache__/constants.cpython-39.pyc +0 -0
  36. src/utils/__pycache__/identifier.cpython-39.pyc +0 -0
  37. src/utils/constants.py +6 -0
  38. src/utils/identifier.py +24 -0
  39. src/utils/lang/__init__.py +0 -0
  40. src/utils/lang/bn/bn.json +0 -0
  41. src/utils/lang/en/en.json +0 -0
  42. src/utils/lang/lang.py +0 -0
  43. static/.gitignore +0 -0
  44. static/history/2023-09-30.txt +177 -0
  45. static/history/2023-10-01.txt +56 -0
  46. static/history/2023-10-20.txt +8 -0
  47. static/history/2023-10-21.txt +32 -0
  48. static/images/shiku.jpg +0 -0
  49. static/images/shiku_half 2.jpg +0 -0
  50. static/images/shiku_half.png +0 -0
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import uvicorn
2
+
3
+ if __name__ == "__main__":
4
+ uvicorn.run(
5
+ app="src.main:api",
6
+ host="0.0.0.0",
7
+ workers=3
8
+ )
definitions.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import os
2
+
3
+ ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ fastapi==0.103.2
2
+ uvicorn[standard]==0.23.2
3
+ numpy==1.21.6
4
+ sentence-transformers==2.2.2
5
+ regex
src/__pycache__/definitions.cpython-39.pyc ADDED
Binary file (242 Bytes). View file
 
src/__pycache__/main.cpython-39.pyc ADDED
Binary file (1.66 kB). View file
 
src/constants/__init__.py ADDED
File without changes
src/main.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from fastapi import Body, FastAPI
3
+ from fastapi.middleware.cors import CORSMiddleware
4
+ from contextlib import asynccontextmanager
5
+ from typing_extensions import Annotated
6
+ from sentence_transformers import SentenceTransformer
7
+ from .processors.dialog.dialog_management import process_input_bn, reset_chatbot
8
+ from .processors.downloader.model_downloader import download
9
+ from .models.request import Request
10
+ from .utils.identifier import Identifier
11
+ from .server.routers import users
12
+ from .utils.constants import Constants
13
+ from definitions import ROOT_DIR
14
+
15
+ # @asynccontextmanager
16
+ # async def lifespan(app: FastAPI):
17
+ # try:
18
+ # model = SentenceTransformer(Constants.MODEL_PATH)
19
+ # except:
20
+ # download()
21
+ # model = SentenceTransformer(Constants.MODEL_PATH)
22
+ # finally:
23
+ # if model:
24
+ # yield
25
+ # reset_chatbot()
26
+ # else:
27
+ # # Something needs to be done here
28
+ # pass
29
+
30
+ # api = FastAPI(lifespan=lifespan)
31
+ # api.include_router(users)
32
+
33
+ api = FastAPI()
34
+
35
+ origins = [
36
+ "http://localhost.tiangolo.com",
37
+ "https://localhost.tiangolo.com",
38
+ "http://localhost",
39
+ "http://localhost:3000",
40
+ ]
41
+
42
+ api.add_middleware(
43
+ CORSMiddleware,
44
+ allow_origins=origins,
45
+ allow_credentials=True,
46
+ allow_methods=["*"],
47
+ allow_headers=["*"],
48
+ )
49
+
50
+ try:
51
+ model = SentenceTransformer(Constants.MODEL_PATH)
52
+ except:
53
+ download()
54
+ model = SentenceTransformer(Constants.MODEL_PATH)
55
+ finally:
56
+ reset_chatbot()
57
+
58
+ @api.get('/')
59
+ async def root():
60
+ return {'data': 'Hello World!'}
61
+
62
+ @api.post('/query')
63
+ async def query(data: Annotated[Request, Body(embed=True)]):
64
+ global model
65
+ query = data.query.lstrip()
66
+ identifier = Identifier(query)
67
+ if (identifier.is_bangla):
68
+ result = process_input_bn(query, model)
69
+ return {'data': result}
70
+ else:
71
+ return {'data': 'I can\'t understand you!'}
src/models/__pycache__/request.cpython-39.pyc ADDED
Binary file (503 Bytes). View file
 
src/models/request.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel, Field
2
+
3
+ class Request(BaseModel):
4
+ query: str = Field(
5
+ title='The sentence for applying NER',
6
+ max_length=1024
7
+ )
src/processors/__init__.py ADDED
File without changes
src/processors/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (170 Bytes). View file
 
src/processors/dialog/__init__.py ADDED
File without changes
src/processors/dialog/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (177 Bytes). View file
 
src/processors/dialog/__pycache__/dialog_management.cpython-39.pyc ADDED
Binary file (4.38 kB). View file
 
src/processors/dialog/dialog_management.py ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import string
4
+ import numpy as np
5
+ from datetime import date, datetime
6
+ from sklearn.metrics.pairwise import cosine_similarity
7
+ from src.processors.nlp.natural_language_understanding import get_intent_bert_avg
8
+ from src.processors.nlp.natural_language_processing import preprocess_bn
9
+ from src.processors.nlp.natural_language_generation import respond_greet_bn
10
+ from definitions import ROOT_DIR
11
+
12
+
13
+ history=[]
14
+ intent=-1
15
+ turn=-1
16
+ eoc='<eoc>' #end of conversations
17
+ similarity_threshold=0.75
18
+ intent_threshold=0.80
19
+
20
+
21
+ def reset_chatbot():
22
+
23
+ """
24
+ This function is used for reseting the chatbot to the initial mode.
25
+ """
26
+
27
+ global turn, history
28
+ turn = -1
29
+ history.clear()
30
+
31
+
32
+
33
+ def process_input_bn(user_input, model):
34
+
35
+ """
36
+ This function is used for processing user input in Bangla.
37
+ First the databases are loaded.
38
+ The core structure is based on turn counts. A turn consists of one question from the user and one response from the chatbot.
39
+ For the first turn, intent is identified.
40
+ After intent identification, the response of the first turn of corresponding intent in picked from the database.
41
+ For rest of the turns, chatbot searchs if the user query is valid or not.
42
+ For valid query, it picks response of corresponding turn and intent.
43
+ For invalid query, it asks for clearification.
44
+ If predefined conversation length exceeds, the chatbot is reset.
45
+ If it requires any verification and information retrieval task, it call anoter function for verification and information retrieval.
46
+ Pseudocode
47
+ -----------------------------------------------
48
+ Preprocess user input.
49
+ Load databases.
50
+ If first turn:
51
+ Identify intent using another function.
52
+ If intent is invalid:
53
+ Show intent suggestions.
54
+ Else:
55
+ Return response of corresponding turn and intent
56
+ Else:
57
+ If conversation length exceeds:
58
+ Show intent suggestions.
59
+ Else if verification or retrieval is required:
60
+ Retrieve information using another functionsss.
61
+ Else:
62
+ If user query is valid:
63
+ Return response of corresponding turn and intent
64
+ Else:
65
+ Ask for clarification.
66
+
67
+ """
68
+
69
+ global turn, history, intent, similarity_threshold, intent_threshold
70
+
71
+ turn+=1
72
+
73
+ processed_input=preprocess_bn(user_input)
74
+
75
+ user_kb_path=os.path.join(ROOT_DIR,'static','knowledge_base','user_queries_v1_bn.json')
76
+ with open(user_kb_path, 'r') as u_f:
77
+ user_kb_bn=json.load(u_f)
78
+
79
+ chatbot_kb_path=os.path.join(ROOT_DIR,'static','knowledge_base','chatbot_queries_v1_bn.json')
80
+ with open(chatbot_kb_path, 'r') as c_f:
81
+ chatbot_kb_bn=json.load(c_f)
82
+
83
+ if turn==0: # for the first turn
84
+ intent, scores=get_intent_bert_avg(user_input, user_kb_bn, model)
85
+ intent_score=scores[intent]
86
+ print('Intent: ', intent)
87
+ # print('Similarity score: ', intent_score)
88
+ print('Similarity Scores: ', scores)
89
+ if intent==-1 or intent_score<intent_threshold or intent is None:
90
+ history.append('user_'+user_input)
91
+ response='সরি, তোমার কথা আমি বুঝতে পারছিনা। আরেকবার বলো।'
92
+ history.append('chatbot_'+response)
93
+ turn=-1
94
+ history.clear()
95
+ else:
96
+ print('here')
97
+ history.append('user_'+user_input)
98
+ response=chatbot_kb_bn[str(intent)][str(turn)][0]
99
+ if '<dayPeriod>' in response:
100
+ response=respond_greet_bn(response)
101
+ history.append('chatbot_'+response)
102
+ else:
103
+ history.append('user_'+user_input)
104
+ if turn==len(user_kb_bn[str(intent)]): # if conversation length exceeds
105
+ response='সরি, তোমার কথা আমি বুঝতে পারছিনা। আরেকবার বলো।'
106
+ history.append('chatbot_'+response)
107
+ turn=-1
108
+ history.clear()
109
+ else:
110
+ idx=-1
111
+ mx_score=0
112
+ user_input_emb=model.encode(processed_input)
113
+ user_input_emb=np.reshape(user_input_emb, (1,user_input_emb.shape[0]))
114
+
115
+ for candidate in user_kb_bn[str(intent)][str(turn)]:
116
+ can_emb=model.encode(candidate)
117
+ can_emb=np.reshape(can_emb, (1,can_emb.shape[0]))
118
+
119
+ score=cosine_similarity(user_input_emb, can_emb)
120
+ if score>mx_score:
121
+ mx_score=score
122
+ idx=user_kb_bn[str(intent)][str(turn)].index(candidate)
123
+
124
+ if mx_score>=similarity_threshold:
125
+ response=chatbot_kb_bn[str(intent)][str(turn)][idx]
126
+ else:
127
+ response='সরি, তোমার কথা আমি বুঝতে পারছিনা। আরেকবার বলো।'
128
+ turn-=1
129
+ history.append('chatbot_'+response)
130
+
131
+ if 'backToTurn' in response:
132
+ _,turn=response.split('_')
133
+ turn=int(turn[:-1])
134
+ response=chatbot_kb_bn[str(intent)][str(turn)][0]
135
+ history.append('chatbot_'+response)
136
+
137
+ if response.endswith(eoc):
138
+
139
+ if intent==14:
140
+ submit_complain(history)
141
+
142
+ today=date.today()
143
+ now=datetime.now()
144
+ time=now.strftime("%H:%M:%S")
145
+
146
+ history_merged='\n'.join(history)
147
+ history_merged2=time+'\n'+history_merged+'\n\n'
148
+
149
+ # print(history_merged2)
150
+
151
+ sub_folder=str(today)
152
+ history_path=os.path.join(ROOT_DIR,'static','history',sub_folder+'.txt')
153
+ f_bn=open(history_path, 'a+')
154
+ f_bn.write(history_merged2)
155
+ f_bn.close()
156
+
157
+ print('Chat history has been saved.')
158
+
159
+ reset_chatbot()
160
+
161
+ return response
src/processors/downloader/__init__.py ADDED
File without changes
src/processors/downloader/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (181 Bytes). View file
 
src/processors/downloader/__pycache__/model_downloader.cpython-39.pyc ADDED
Binary file (588 Bytes). View file
 
src/processors/downloader/model_downloader.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from sentence_transformers import SentenceTransformer, models
3
+ from definitions import ROOT_DIR
4
+
5
+ def download():
6
+ model_dir=os.path.join(ROOT_DIR, 'static', 'models')
7
+ model_name='bert-base-multilingual-uncased'
8
+
9
+ model=SentenceTransformer(model_name)
10
+
11
+ model.save(os.path.join(model_dir,model_name))
src/processors/nlp/__pycache__/natural_language_generation.cpython-39.pyc ADDED
Binary file (800 Bytes). View file
 
src/processors/nlp/__pycache__/natural_language_processing.cpython-39.pyc ADDED
Binary file (626 Bytes). View file
 
src/processors/nlp/__pycache__/natural_language_understanding.cpython-39.pyc ADDED
Binary file (3.36 kB). View file
 
src/processors/nlp/natural_language_generation.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import string
2
+ from datetime import date, datetime
3
+
4
+
5
+
6
+ def respond_greet_bn(template_response):
7
+
8
+ now=datetime.now()
9
+ time_now=now.strftime("%H:%M:%S")
10
+ h,m,_=time_now.split(':')
11
+ minutes=int(h)*60+int(m)
12
+
13
+ day_period=''
14
+
15
+ if minutes>300 and minutes<=720:
16
+ day_period='সকাল'
17
+ elif minutes>720 and minutes<=1020:
18
+ day_period='বিকাল'
19
+ elif minutes>1020 and minutes<=1260:
20
+ day_period='সন্ধ্যা'
21
+ elif minutes>1260 or minutes<=300:
22
+ day_period='রাত্রি'
23
+
24
+ response=template_response.replace('<dayPeriod>', day_period)
25
+
26
+ return response
src/processors/nlp/natural_language_processing.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import string
2
+
3
+
4
+
5
+ def preprocess_bn(txt):
6
+
7
+ """
8
+ This functions is used for preprocessing Bangla text.
9
+ Two major preprocessing is done-
10
+ 1. Punctuations removal.
11
+ 2. Whitespace removal.
12
+ Processed text is returned as a return value.
13
+ """
14
+
15
+ for punc in string.punctuation:
16
+ txt=txt.replace(punc, '')
17
+ txt=txt.replace('।', '')
18
+
19
+ txt=' '.join(txt.split())
20
+
21
+ return txt
src/processors/nlp/natural_language_understanding.py ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ from datetime import date, datetime
3
+ from sklearn.metrics.pairwise import cosine_similarity
4
+
5
+
6
+
7
+ def get_intent(txt, db):
8
+
9
+ """
10
+ This function is used for identifying intent using a keyword based approach.
11
+ Some predefined set of keywords (associated with intent id) are searched with the given string.
12
+ The intent id of first matched keyword is returned as the intent.
13
+ Keywords are manually picked and arranged in such way and sequence that only correct intent is returned.
14
+ Works of smaller dataset.
15
+ """
16
+
17
+ for i in range(len(db)):
18
+ for keyword in db[str(i)]['keywords']:
19
+ if keyword in txt:
20
+ return i
21
+
22
+
23
+ def get_intent_bert(txt, db, model):
24
+
25
+ """
26
+ This function is used for identifying intent using sentence similarity approach.
27
+ BERT pre-trained model has been used for getting the sentence embeddings.
28
+ Cosine similarity is used for getting the similarity score.
29
+ A predefined set of questions with associate intent label has been kept in a database.
30
+ For each intent label, there are multiple questions.
31
+ Intent of the highest similarity score is returned.
32
+ Pseudocode
33
+ -----------------------------------------------
34
+ Get the embeddings of the given text.
35
+ For each intent:
36
+ For each question of that intent:
37
+ Get the embedding of the question
38
+ Calculate similarity score
39
+ Update maximum score and intent to be returned
40
+ Return the intent
41
+ """
42
+
43
+
44
+ rv=-1
45
+ mx_score=-1
46
+ txt_emb=model.encode(txt)
47
+ txt_emb=np.reshape(txt_emb, (1,txt_emb.shape[0]))
48
+
49
+ for intent in range(len(db)):
50
+ candidates=db[str(intent)]['0']
51
+
52
+ for candidate in candidates:
53
+ can_emb=model.encode(candidate)
54
+ can_emb=np.reshape(can_emb, (1,can_emb.shape[0]))
55
+
56
+ score=cosine_similarity(txt_emb, can_emb)
57
+ if score>mx_score:
58
+ mx_score=score
59
+ rv=intent
60
+
61
+ return rv, mx_score
62
+
63
+
64
+ def get_intent_bert_avg(txt, db, model):
65
+
66
+ """
67
+ This function is used for identifying intent using sentence similarity approach.
68
+ BERT pre-trained model has been used for getting the sentence embeddings.
69
+ Cosine similarity is used for getting the similarity score.
70
+ A predefined set of questions with associate intent label has been kept in a database.
71
+ For each intent label, there are multiple questions.
72
+ An average similarity score is calculated for each intent over the questions.
73
+ Intent of the highest average similarity score is returned.
74
+ Pseudocode
75
+ -----------------------------------------------
76
+ Get the embeddings of the given text.
77
+ For each intent:
78
+ For each question of that intent:
79
+ Get the embedding of the question
80
+ Calculate similarity score
81
+ Calculate average similarity score that that intent
82
+ Return intent of highest average similarity score
83
+ """
84
+
85
+ rv=-1
86
+ mx_score=-1
87
+
88
+ txt_emb=model.encode(txt)
89
+ txt_emb=np.reshape(txt_emb, (1,txt_emb.shape[0]))
90
+
91
+ scores_all=[]
92
+ for intent in range(len(db)):
93
+ candidates=db[str(intent)]['0']
94
+
95
+ scores=[]
96
+ for candidate in candidates:
97
+ can_emb=model.encode(candidate)
98
+ can_emb=np.reshape(can_emb, (1,can_emb.shape[0]))
99
+
100
+ score=cosine_similarity(txt_emb, can_emb)
101
+ scores.append(score)
102
+
103
+ scores_all.append(np.mean(scores))
104
+
105
+ intent=np.argmax(scores_all)
106
+
107
+ return intent, scores_all
src/server/__init__.py ADDED
File without changes
src/server/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (166 Bytes). View file
 
src/server/router.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from fastapi import APIRouter
src/server/routers/__pycache__/users.cpython-39.pyc ADDED
Binary file (1.01 kB). View file
 
src/server/routers/auth.py ADDED
File without changes
src/server/routers/users.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import Body, APIRouter
2
+ from typing_extensions import Annotated
3
+ from src.models.request import Request
4
+ from sentence_transformers import SentenceTransformer
5
+ from src.processors.dialog.dialog_management import process_input_bn, reset_chatbot
6
+ from src.processors.downloader.model_downloader import download
7
+ from src.utils.identifier import Identifier
8
+ from definitions import ROOT_DIR
9
+
10
+ router = APIRouter()
11
+
12
+ @router.post('/query')
13
+ async def query(data: Annotated[Request, Body(embed=True)]):
14
+ query = data.query.lstrip()
15
+ identifier = Identifier(query)
16
+ if (identifier.is_bangla):
17
+ result = process_input_bn(query, model)
18
+ return {'data': result}
19
+ else:
20
+ return {'data': 'I can\'t understand you!'}
src/server/routes.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import Body, FastAPI
2
+ from typing_extensions import Annotated
3
+ from src.models.request import Request
4
+
5
+ class Routes:
6
+ def __init__(self):
7
+ self.api = FastAPI()
8
+
9
+ @api.get('/')
10
+ async def index(self):
11
+ return {'message': 'Hello World!'}
12
+
13
+ api = FastAPI()
14
+
15
+
16
+
17
+ @api.post('/query')
18
+ async def query(data: Annotated[Request, Body(embed=True)]):
19
+ handler = Handler(data.query)
20
+ response = handler.tag()
21
+ return {'data': response}
src/utils/__init__.py ADDED
File without changes
src/utils/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (165 Bytes). View file
 
src/utils/__pycache__/constants.cpython-39.pyc ADDED
Binary file (498 Bytes). View file
 
src/utils/__pycache__/identifier.cpython-39.pyc ADDED
Binary file (796 Bytes). View file
 
src/utils/constants.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import os
2
+ from definitions import ROOT_DIR
3
+
4
+ class Constants:
5
+ MODEL_NAME = 'bert-base-multilingual-uncased'
6
+ MODEL_PATH = os.path.join(ROOT_DIR, 'static', 'models', MODEL_NAME)
src/utils/identifier.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import regex
2
+
3
+
4
+ """
5
+ This class is used to identify if a string contains any bangla word or not
6
+ |-------------------------------------------------------------------------------------------------|
7
+ | * This class is written for basic usage, it can be improved dramatically |
8
+ | * Changing the for loop with a binary search would result in finding specific bangla word index |
9
+ | * Sorting the word chunks based on lexicographic order would also produce better results |
10
+ |-------------------------------------------------------------------------------------------------|
11
+ """
12
+ class Identifier:
13
+ pattern = r"\P{L}*\p{Bengali}+(?:\P{L}+\p{Bengali}+)*\P{L}*"
14
+ is_bangla = False
15
+
16
+ def __init__(self, query):
17
+ self.parts = query.split(' ')
18
+ for part in self.parts:
19
+ if bool(regex.match(self.pattern, part)):
20
+ self.is_bangla = True
21
+ break
22
+
23
+ def is_bangla(self) -> bool:
24
+ return self.is_bangla
src/utils/lang/__init__.py ADDED
File without changes
src/utils/lang/bn/bn.json ADDED
File without changes
src/utils/lang/en/en.json ADDED
File without changes
src/utils/lang/lang.py ADDED
File without changes
static/.gitignore ADDED
File without changes
static/history/2023-09-30.txt ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 22:50:22
2
+ user_একাত্তরের দিনগুলো বইটি কে লিখছেন?
3
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
4
+
5
+ 22:50:31
6
+ user_জাহানারা ইমাম কে?
7
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
8
+
9
+ 22:50:55
10
+ user_জাহানারা ইমামকে শহীদ জননী বলা হয় কেন?
11
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
12
+
13
+ 22:51:00
14
+ user_রুমী কে?
15
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
16
+
17
+ 22:52:25
18
+ user_রুমীর নিয়ে আসা স্টিকারে কি লেখা ছিল?
19
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
20
+
21
+ 22:52:40
22
+ user_স্টিকারটি কে ডিজাইন করেছিল?
23
+ chatbot_স্টিকারটি শিল্পী কামরুল হাসান ডিজাইন করেছিলেন।<eoc>
24
+
25
+ 22:59:36
26
+ user_হ্যালো
27
+ chatbot_শুভ <dayPeriod>। আমি শিকু। বলো কি জানতে চাও? <eoc>
28
+
29
+ 23:00:45
30
+ user_হ্যালো
31
+ chatbot_শুভ <dayPeriod>। আমি শিকু। বলো কি জানতে চাও? <eoc>
32
+
33
+ 23:00:49
34
+ user_হ্যালো
35
+ chatbot_শুভ <dayPeriod>। আমি শিকু। বলো কি জানতে চাও? <eoc>
36
+
37
+ 23:04:54
38
+ user_হ্যালো
39
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
40
+
41
+ 23:05:01
42
+ user_জাহানারা ইমাম কে?
43
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
44
+
45
+ 23:05:24
46
+ user_শাফী ইমাম রুমী কে?
47
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
48
+
49
+ 23:26:24
50
+ user_হ্যালো
51
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
52
+
53
+ 23:26:44
54
+ user_আচ্ছা জাহানারা ইয়ামা কে?
55
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
56
+
57
+ 23:26:51
58
+ user_রুমী কে?
59
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
60
+
61
+ 23:27:21
62
+ user_শাফী ইমাম রুমী কে?
63
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
64
+
65
+ 23:27:52
66
+ user_একাত্তরের দিনগুলো কে লিখেছেন?
67
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
68
+
69
+ 23:28:25
70
+ user_জাহানারা ইমামকে শহীদ জননী বলা হয়ে কেন?
71
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
72
+
73
+ 23:30:15
74
+ user_রুমীর নিয়ে আসা স্টিকারটিতে কি লেখা ছিল?
75
+ user_রুমীর নিয়ে আসা স্টিকারটিতে কি লেখা ছিল?
76
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
77
+
78
+ 23:30:42
79
+ user_স্টিকারটি কে বানিয়েছিল?
80
+ chatbot_স্টিকারটি শিল্পী কামরুল হাসান ডিজাইন করেছিলেন।<eoc>
81
+
82
+ 23:39:10
83
+ user_একাত্তরের দিনগুলো কে লিখেছেন?
84
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
85
+
86
+ 23:39:20
87
+ user_জাহানারা ইমাম কে?
88
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
89
+
90
+ 23:39:39
91
+ user_জাহানারা ইমামকে শহীদ জননী বলা হয় কেন?
92
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
93
+
94
+ 23:39:47
95
+ user_শাফী ইমাম রুমী কে?
96
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
97
+
98
+ 23:40:04
99
+ user_রুমী নিয়ে আসা স্টিকারে কি লেখা ছিল?
100
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
101
+
102
+ 23:40:24
103
+ user_স্টিকারটির ডিজাইন কে করেছিলেন?
104
+ chatbot_স্টিকারটি শিল্পী কামরুল হাসান ডিজাইন করেছিলেন।<eoc>
105
+
106
+ 23:41:04
107
+ user_কামরুল হাসান কি নামে সমিতি গঠন করেছিলেন?
108
+ chatbot_কামরুল হাসান 'বাংলা পটুয়া সমাজ' নামে সমিতি গঠন করেছিলেন।<eoc>
109
+
110
+ 23:42:37
111
+ user_একাত্তরের দিনগুলো বইটির লেখক কে?
112
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
113
+
114
+ 23:42:49
115
+ user_জাহানারা ইমাম কে
116
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
117
+
118
+ 23:46:13
119
+ user_হ্যালো
120
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
121
+
122
+ 23:46:24
123
+ user_একাত্তরের দিনগুলো কে লিখেছেন?
124
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
125
+
126
+ 23:46:48
127
+ user_আচ্ছা জাহানারা ইয়ামা কে?
128
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
129
+
130
+ 23:46:59
131
+ user_জাহানারা ইমামকে শহীদ জননী বলা হয়ে কেন?
132
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
133
+
134
+ 23:47:13
135
+ user_শাফী ইমাম রুমী কে?
136
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্��ে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
137
+
138
+ 23:47:22
139
+ user_রুমীর নিয়ে আসা স্টিকারটিতে কি লেখা ছিল?
140
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
141
+
142
+ 23:47:31
143
+ user_স্টিকারটি কে বানিয়েছিল?
144
+ chatbot_স্টিকারটি শিল্পী কামরুল হাসান ডিজাইন করেছিলেন।<eoc>
145
+
146
+ 23:55:44
147
+ user_হাই
148
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
149
+
150
+ 23:56:03
151
+ user_একাত্তের দিনগুলো বইটি কে লিখেছেন?
152
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
153
+
154
+ 23:56:11
155
+ user_জাহানারা ইমাম কে?
156
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
157
+
158
+ 23:56:28
159
+ user_তাকে শহীদ জননী বলা হয় কেন?
160
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
161
+
162
+ 23:56:42
163
+ user_শাফী ইমাম রুমী কে?
164
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
165
+
166
+ 23:57:00
167
+ user_রুমী যে স্টিকারটি এনেছিল, তাতে কি লেখা চই?
168
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
169
+
170
+ 23:57:10
171
+ user_স্টিকারটি কে ডিজাইন করেছেন?
172
+ chatbot_স্টিকারটি শিল্পী কামরুল হাসান ডিজাইন করেছিলেন।<eoc>
173
+
174
+ 23:59:31
175
+ user_কামরুল হাসান যে সমিতি গঠন করেছিলেন তার নাম কি?
176
+ chatbot_কামরুল হাসান 'বাংলা পটুয়া সমাজ' নামে সমিতি গঠন করেছিলেন।<eoc>
177
+
static/history/2023-10-01.txt ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 00:12:31
2
+ user_হ্যালো
3
+ chatbot_শুভ রাত্রি। আমি শিকু। বলো কি জানতে চাও? <eoc>
4
+
5
+ 00:12:45
6
+ user_একাত্তরের দিনগুলো কে লিখেছেন?
7
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
8
+
9
+ 14:45:29
10
+ user_হ্যালো
11
+ chatbot_শুভ বিকাল। আমি শিকু। বলো কি জানতে চাও? <eoc>
12
+
13
+ 14:45:51
14
+ user_একাত্তরের দিনগুলি বইটি কে লিখেছেন?
15
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
16
+
17
+ 14:46:12
18
+ user_জাহানারা ইমাম কে?
19
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
20
+
21
+ 14:46:25
22
+ user_জাহানারা ইমামকে কেন শহীদ জননী বলা হয়?
23
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানারা ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
24
+
25
+ 14:46:36
26
+ user_শাফী ইমাম রুমী কে?
27
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
28
+
29
+ 14:47:39
30
+ user_হ্যালো
31
+ chatbot_শুভ বিকাল। আমি শিকু। বলো কি জানতে চাও? <eoc>
32
+
33
+ 14:50:03
34
+ user_হ্যালো
35
+ chatbot_শুভ বিকাল। আমি শিকু। বলো কি জানতে চাও? <eoc>
36
+
37
+ 14:50:45
38
+ user_একাত্তরের দিনগুলি কে লিখেছেন?
39
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
40
+
41
+ 14:50:59
42
+ user_জাহানারা ইমাম কে ছিলেন?
43
+ chatbot_জাহানারা ইমাম ছিলেন ১৯২৯ সালের ৩ মে বর্তমান পশ্চিমবঙ্গের মুর্শিদাবাদে বড়ঞা থানার অন্তর্ভুক্ত সুন্দরপুর গ্রামে জন্মগ্রহণ করেন। তিনি একজন বাংলাদেশী লেখিকা, কথাসাহিত্যিক, শিক্ষাবিদ এবং একাত্তরের ঘাতক দালাল বিরোধী আন্দোলনের নেত্রী ছিলেন। তিনি বাংলাদেশে শহীদ জননী হিসেবে পরিচিত। ১৯৯৪ সালের ২৬ জুন মার্কিন যুক্তরাষ্ট্রের মিশিগানের ডেট্রয়েট নগরীর সাইনাই হাসপাতালে ক্যান্সারে আক্রান্ত হয়ে মৃত্যু বরণ করেন।<eoc>
44
+
45
+ 14:51:48
46
+ user_জাহানারা ইমামকে শহীদ জননী কেন বলা হয়?
47
+ chatbot_তাঁর ছেলে শাফী ইমাম রুমী দেশের জন্য প্রাণ বিসর্জন দিয়েছিল। বিজয় লাভের পর রুমির বন্ধুরা রুমীর মা জাহানা��া ইমামকে সকল মুক্তিযোদ্ধার মা হিসেবে বরণ করে নেয়। তাই তাঁকে "শহীদ জননী" বলে আখ্যায়িত করা হয়।<eoc>
48
+
49
+ 14:56:40
50
+ user_শাফী ইমাম রুমী কে?
51
+ chatbot_রুমী জাহানারা ইমামের পুত্র। সে মুক্তিযুদ্ধের সময় গেরিলা যুদ্ধে অংশগ্রহণ করেছিলেন এবং শহিদ হয়েছিলেন।<eoc>
52
+
53
+ 14:57:42
54
+ user_এটি কোন বিষয় নিয়ে লেখা হয়েছে?
55
+ chatbot_এটি মুক্তিযুদ্ধের সময়ের প্রতিদিনের ঘটনা নিয়ে লেখা হয়েছে।<eoc>
56
+
static/history/2023-10-20.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ 17:42:39
2
+ user_হ্যালো
3
+ chatbot_শুভ সন্ধ্যা। আমি শিকু। বলো কি জানতে চাও? <eoc>
4
+
5
+ 22:46:25
6
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
7
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
8
+
static/history/2023-10-21.txt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 00:18:01
2
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
3
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
4
+
5
+ 00:30:18
6
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
7
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
8
+
9
+ 01:44:46
10
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
11
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
12
+
13
+ 01:50:20
14
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
15
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
16
+
17
+ 01:56:53
18
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
19
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
20
+
21
+ 01:57:20
22
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
23
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
24
+
25
+ 01:57:46
26
+ user_একাত্তরের দিনগুলি বইটির লেখক কে?
27
+ chatbot_একাত্তরের দিনগুলি বইটি জাহানারা ইমাম লিখেছেন।<eoc>
28
+
29
+ 01:58:58
30
+ user_রুমীর নিয়ে আসা স্টিকারে কি লেখা ছিল?
31
+ chatbot_রুমীর নিয়ে আসা স্টিকারে 'একেকটি বাংলা অক্ষর একেকটি বাঙালির জীবন' লেখা ছিল।<eoc>
32
+
static/images/shiku.jpg ADDED
static/images/shiku_half 2.jpg ADDED
static/images/shiku_half.png ADDED