Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBLACK11 committed Feb 12, 2024
1 parent 499c9eb commit 4397597
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 40 deletions.
58 changes: 19 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,22 @@ Key Features:
- Dynamic computational graphs enable on-the-fly changes to models.
- Autograd for automatic differentiation and gradient computation.
- GPU support for accelerated training of neural networks.
### NLTK (Natural Language Toolkit)
### NLTK (Natural Language Toolkit)(v1)
NLTK is a comprehensive library for natural language processing (NLP) and text analysis tasks in Python. It offers tools for tokenization, stemming, part-of-speech tagging, syntactic parsing, and more. NLTK is widely used for processing and understanding human language data, making it a valuable asset in various language-related projects.
Key Features:
- Tokenization: Splitting text into words or sentences.
- Stemming: Reducing words to their base or root form.
- Part-of-speech tagging: Identifying grammatical components of words.
- Syntactic parsing: Analyzing sentence structure for deeper understanding.
### LASER Encoder
The [Laser Encoder](https://github.com/facebookresearch/LASER), developed by Meta AI Research, is a powerful tool used for generating embeddings for sentences, regardless of the language they're written in. Embeddings are numerical representations of text that capture semantic meaning, enabling machines to understand and compare textual data effectively.

Unlike traditional methods that treat each language independently, the Laser Encoder utilizes a unified model that considers the semantic similarity of sentences across different languages. This means that sentences conveying similar meanings in different languages will have embeddings that are close together in the embedding space, facilitating cross-lingual comparisons and tasks.

By leveraging the Laser Encoder, applications like ChatBanker can provide seamless multilingual support. For example, when a user inputs a query or message in one language, ChatBanker can use the embeddings generated by the Laser Encoder to identify similar content in other languages. This capability enhances the user experience by enabling effective communication and understanding across language barriers, making ChatBanker more accessible and versatile for a global audience.

### Google Translate (Googletrans)
[Googletrans](https://pypi.org/project/googletrans/) is a Python library that provides easy access to the Google Translate API. It allows developers to integrate translation capabilities into their applications seamlessly. Googletrans offers a simple interface for translating text between various languages, making it a valuable tool for multilingual applications like ChatBanker. With Googletrans, ChatBanker can provide real-time translation services, enabling users to communicate effortlessly across language barriers. This technology enhances ChatBanker's accessibility and usability for users worldwide.

## Working of the ChatBot

Expand All @@ -127,50 +136,21 @@ For visual reference, here's a sneak peek at what interacting with the bot on Te
Engage with the chatbot to discover its potential and witness firsthand how it addresses different user needs and inquiries."




## Requirements
- Python 3.6 or higher
- Telegram API token
- MongoDB instance
- Docker

## Installation
- Clone this repository and navigate to the project directory.

git clone https://github.com/NIXBLACK11/telegramOrganizationChatBot.git

- Install pyTorch using this command

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

- Install the required Python packages by running the following command:

pip install -r requirements.txt

- To install nltk tokenizer

python3 -c "import nltk;nltk.download('punkt')"

- Create a new Telegram bot by following the instructions in the Telegram Bot documentation.

- Create a MongoDB instance and obtain the connection URL.

- Create a .env file in the root directory of the project and set the following environment variables:

BOT_TOKEN=<Your Telegram API token>
DATABASE_URL=<Your MongoDB connection URL>

## Usage
To start the chat bot, run the following command:

python bot.py

## Docker
To build the Docker image, run the following command:
## Installation and Usage
### [V1 Installation and Usage](./v1/README.md)
### [V2 Installation and Usage](./v2/README.md)

docker image pull nixblack/chatbot:banker
## Difference between both versions

To start the Docker container, run the following command:
| Feature | Version v1 | Version v2 |
|---------------------|----------------------------------------------|------------------------------------------------------|
| Security | Basic authentication methods are employed. | Utilizes Telegram-based IDs for user authentication, ensuring transactions are securely tied to unique user IDs. |
| Multi-language setup| Limited language support, primarily in one language. | Incorporates a laser encoder for generating embeddings, allowing the bot to understand and respond in multiple languages efficiently. |
| Easier flow | Code readability may be suboptimal, leading to potential confusion. | Enhanced code readability and flow, resulting in a more intuitive user experience and easier maintenance. |

docker run -d --env-file .env nixblack/chatbot:banker
37 changes: 36 additions & 1 deletion v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,39 @@ Logits generated by this layer gauge the network's intent confidence based on in
The Cross-Entropy Loss serves as the guiding compass for model training, gauging the dissimilarity between predicted intent probabilities and actual intent labels in the training data.
#### Optimizer: Adam Optimizer (torch.optim.Adam)

The project harnesses the power of the Adam optimizer, known for its adaptive learning rate mechanism. By adjusting learning rates based on gradient moments, this optimizer ensures efficient and stable convergence.
The project harnesses the power of the Adam optimizer, known for its adaptive learning rate mechanism. By adjusting learning rates based on gradient moments, this optimizer ensures efficient and stable convergence.

## Installation
- Clone this repository and navigate to the project directory.

git clone https://github.com/NIXBLACK11/telegramOrganizationChatBot.git

- Install pyTorch using this command

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

- Go to the v1 directory

cd v1

- Install the required Python packages by running the following command:

pip install -r requirements.txt

- To install nltk tokenizer

python3 -c "import nltk;nltk.download('punkt')"

- Create a new Telegram bot by following the instructions in the Telegram Bot documentation.

- Create a MongoDB instance and obtain the connection URL.

- Create a .env file in the root directory of the project and set the following environment variables:

BOT_TOKEN=<Your Telegram API token>
DATABASE_URL=<Your MongoDB connection URL>

## Usage
To start the chat bot, run the following command:

python bot.py

0 comments on commit 4397597

Please sign in to comment.