Giter Site home page Giter Site logo

chatbotpublic's Introduction

This Project was made in collaboration with git users: https://github.com/baranbbr, https://github.com/Vendari, https://github.com/bochnotomas An example video of the chatbot in action can be found at: https://youtu.be/YGjHxd8RXtc

Intro: This project was a group university project which made use of popular programs such as Git and Pycharm to develop a working chatbot in which we named Sven. Based around the game Minecraft, this chatbot enables responses to questions about item crafting recipes, their descriptions and other standard chat responses all incorporated within both discord and the Minecraft chat itself, hosted on a VPS server. The project as a whole was meant to help re-introduce Minecraft players who had played the game in the past but however, after the numerous complex updates had fallen out of touch with key game mechanics, crafting recipes and block uses.

Initially: All code written was written in an object-oriented style to make the code more readable to one another and allow for encapsulation for specific functions so they could be easily developed around. Original task: At the start of our development we individually devised which parts we should partake in to contribute to the project as a whole. My first task was input refactoring, the goal was to take a sentence from a text input and cut it down into a very simplified 2D array of the word, the amount of times it occurred within the sentence and the type of word it was, to allow us to remove unnecessary words that would not be associated to any type of response. This code would also remove unimportant characters such as ',' which had no real meaning within the sentence. I used a Numpy array. The documentation for it was simple and it followed strict data type and size parameters similar to an SQL database meaning if incorrect data was somehow added it would not allow it to be added to the array. Furthermore, to identify word type of every word in a dictionary I decided to use NLTK and WordNet, a corpus reader which allowed me to search said database and retrieve each word type. This I then simplified further as the standard NLTK text system of referencing was too complex for the project as it contained multiple variation of types like nouns which would be insignificant to the final solution, by using a hand typed dictionary as seen at the start of the inputRefactor.py.

All code in inputRefactor.py was written by myself however, the code was reformatted slightly by the Jakub the python master to make the object oriented part of the code more efficient.

Secondary Task: The link connecting Minecraft to Python code was more difficult than we first imagined as Minecraft itself was written in Java there was no immediate solution to the problem on Google. The first development came when McPi was found, a project for controlling Minecraft through a Raspberry Pi however the Minecraft version was a specialised version for the Raspberry Pi and if we continued with this our end goal of introducing old Minecraft player to the new version of Minecraft would not be fulfilled. A GitHub project was found called RaspberryJuice which built upon the McPi code to enable a Spigot Minecraft server to host it using ports as a way to communicate with Python code. In the next phase, with the help Jakub and Baran I implemented the game with the plugin installed using Jakub’s server and a workaround to open ports that allowed information to be extracted. The source code was very out of date of the version, and consequently and had an issue that was fixed by editing the spawn location in the file to adjust its reference of where the blocks were ingame. The code itself used an ongoing while loop to detect user input and outputted a response based on if the chatbot was asked (if "Sven" was typed) and then replied with teleport actions if the sentence included "teleport" or just text based response ("Sven hello" would return "Hey (userID)") it further used other functions developed by the rest of the team such as the webscraping to determine crafting and identifying questions allowing an image to be returned with the correct crafting recipe of any item the user asked. Lastly, the last functionality of the bot was the on/off setting that enabled players to turn on/off Sven in order to stop background processing. An ingame command was run using block updates from the plugin with command blocks (as RaspberryJuice itself had minimal features) (/bossbar set minecraft:1 visible true) to enable an onscreen bar in the players vision allowing them to identify if the bot was active.

Similarly, all code in minecraftConnection.py was written by myself however, the code was reformatted slightly by Jakub to make the object oriented part of the code more efficient.

Short Summary: My contributions to the project were: -Using Scrum methodology with the website 'Trello' to keep track of overall progress as well as setting additional tasks. -Using Python (Pycharm) to develop an input refactor to modify the input by parsing each word individually into an simplified interpretable 2d Numpy array with its word, amount of times the word occurs and type of word (noun). This was done by referencing a corporus using NLTK. -Using Python and SSH on a server to install Minecraft Bukkit and link the program using the plugin RaspberryJuice which allows python to communicate using server ports.

Overall: During my project I was able to; enhance my skills with GitHub being able to work side by side with other programmers both more and less experienced than myself, learnt how to use Pycharm, the most popular IDE, work as a team effectively by program in modules rather than linearly, develop my object oriented skills in python allowing code to communicate more efficiently as well as develop my Agile skills using methods like the Kanban board, paired programming and Scrum meetings (in which we scheduled every Wednesday). I also furthered my team working skills as the planned meeting on Wednesday and Friday allowed our group as a whole to communicate on both the project as a whole and what technologies/methods we should use to work around our individual problems. We had to use agile to adapt out project especially in the Friday meets where alterations to plan had to make in order to solve problems. Additionally, due to unforeseen circumstances during this project a different team member was swapped into our group replacing a member that left. This made us have to quickly adapt to the fact the new person was not caught up to the project and didn’t have the same skill set of his predecessor but fortunately using the previous set up meeting dates he was incorporated into the project with minimal problems.

Reflection: Alterations to the project that would have made it more efficient, was shorter but more frequent scrum time to allowed progression of difficult issues that the team could work on as a whole. Looking for more example videos and tutorials before looking at documentation for large libraries to understand specifically the functions of said library’s you need to use (NLTK). Some problems would be more effectively solved by writing in a different language and connecting to that code as a library instead of strictly sticking to Python. Used Technologies: Python 3.6 (Pycharm), NLTK, Numpy arrays, Git/Github, Trello

chatbotpublic's People

Contributors

owncly avatar baranbbr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.