Skip to content
Permalink
Browse files
Create master branch via GitHub
  • Loading branch information
cepulisb committed Nov 29, 2018
1 parent 45730f9 commit 0170169fc63ceced3e32077ef7eec387c8eb3faa
Show file tree
Hide file tree
Showing 10 changed files with 1,335 additions and 0 deletions.
BIN +285 Bytes images/code.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +5.93 KB images/pattern.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +339 Bytes images/tar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +218 Bytes images/top.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +337 Bytes images/zip.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

@@ -0,0 +1,52 @@
(function($) {
$(document).ready(function(){

// putting lines by the pre blocks
$("pre").each(function(){
var pre = $(this).text().split("\n");
var lines = new Array(pre.length+1);
for(var i = 0; i < pre.length; i++) {
var wrap = Math.floor(pre[i].split("").length / 70)
if (pre[i]==""&&i==pre.length-1) {
lines.splice(i, 1);
} else {
lines[i] = i+1;
for(var j = 0; j < wrap; j++) {
lines[i] += "\n";
}
}
}
$(this).before("<pre class='lines'>" + lines.join("\n") + "</pre>");
});

var headings = [];

var collectHeaders = function(){
headings.push({"top":$(this).offset().top - 15,"text":$(this).text()});
}

if($(".markdown-body h1").length > 1) $(".markdown-body h1").each(collectHeaders)
else if($(".markdown-body h2").length > 1) $(".markdown-body h2").each(collectHeaders)
else if($(".markdown-body h3").length > 1) $(".markdown-body h3").each(collectHeaders)

$(window).scroll(function(){
if(headings.length==0) return true;
var scrolltop = $(window).scrollTop() || 0;
if(headings[0] && scrolltop < headings[0].top) {
$(".current-section").css({"opacity":0,"visibility":"hidden"});
return false;
}
$(".current-section").css({"opacity":1,"visibility":"visible"});
for(var i in headings) {
if(scrolltop >= headings[i].top) {
$(".current-section .name").text(headings[i].text);
}
}
});

$(".current-section a").click(function(){
$(window).scrollTop(0);
return false;
})
});
})(jQuery)
@@ -0,0 +1,6 @@
{
"name": "Showcase",
"tagline": "",
"body": "# CHATBOT PROJECT\r\n## INTRODUCTION\r\n### Our team bot was created to do multifunctional exercises such as:\r\n- chating with bot in natural language\r\n- getting the weather in any locations\r\n- taking video form youtube\r\n- getting jokes from huge library in the internet\r\n\r\n## CHOOSING DISCORD\r\nThe bot was created in [discord](https://discordapp.com/) app which was the best choice for our team.\r\n\r\n As a result we gained easy communication throught the team and it was extremely easy to demonstrate our chatbots and progress each week.\r\n \r\n## MY PART IN THE TEAM\r\n\r\nIn the beginning it was hard for me to get used to discord and creating the bot because other team members was already had a bit of practice with it and for me it was the first time.\r\n\r\n## STARTING\r\n\r\nFor the beginning I started with creating my own bot which was not that hard when the internet is full of information how to do it. For the beginning I choosed the [YOUTUBE](https://www.youtube.com/watch?v=_0LXIvLDhBM&t=3s&list=PLzE_B20lY-944hackNm7PVY011B0lPqMI&index=20) video which also helped me to write first code.\r\n\r\n```EXAMPLE OF MY FIRST CODE```\r\n\r\n```python\r\ndef check_for_emoji(self, sentence):\r\n if sentence == \"crying\":\r\n return (\":joy:\")\r\n if sentence == \"cool\":\r\n return (\":sunglasses:\")\r\n if sentence == \"ok\":\r\n return (\":ok_hand:\")\r\n if sentence == \"USA\":\r\n return (\":flag_um:\")\r\n if sentence == \"UK\":\r\n return (\":flag_gb:\")\r\n if sentence == \"really bad\":\r\n return (\":poop:\")\r\n if sentence == \"lithuania\":\r\n return (\":flag_lt:\")\r\n if sentence == \"kiss\":\r\n return (\":kissing_heart:\")\r\n if sentence == \"happy\":\r\n return (\":smiley:\")\r\n if sentence == \"angry\":\r\n return ( \":imp:\")\r\n if sentence == \"cookie\":\r\n return (\":cookie:\")\r\n```\r\n![emoji example](photos/emoji.png)\r\n\r\n\r\n\r\n\r\n\r\n\r\n## REAL WORK\r\n\r\nAfter few tests with the team we considered to create [NLP](https://en.wikipedia.org/wiki/Natural_language_processing).\r\n\r\nAt first we tried a bit with [Rasa_NLU](https://rasa.com/docs/nlu/) but then we started to create it form the scratch. There my suffer started.\r\n\r\nFor the first steps I needed to create keywords for my bot that he could understand for what he should answer.\r\n\r\n```EXAMPLE OF THE KEYWORDS```\r\n```python\r\nGREETING_KEYWORDS = (\"hello\", \"hi\", \"greetings\", \"sup\", \"good evening\",\"good morning\",\"helo\", \"bonjour\", )\r\n\r\nGREETING_RESPONSES = [\"'sup bro\", \"hey\", \"good morning\", \"hello\"]\r\n\r\n\r\n\r\nDOING_KEYWORDS = (\"how are you doing?\", \"how are you?\")\r\n\r\nDOING_RESPONSES = [\"I'am doing great\",\"I'm doing fine\",\"I'm alright\",\"I'm doing terrible\", \"I'm doing really bad\",\"I'm doing bad\"] \r\n\r\nASKING_ABOUT_YOU = [\"And what about you?\", \"how bout you?\",\"what about you?\", \"and you?\"]\r\n\r\nJOKES_KEYWORDS = [\"give me jokes\", \"joke\", \"can u give me joke?\", \"can u give me jokes?\",\"can you please give me some jokes?\", \"jokes\"]\r\n```\r\n\r\nSo I done this just because when you write something for the bot and if your word is the same as input words then the bot replay for you with given outcome words \r\nThere I used lists for outcome words and tuples for the income \r\nwords.\r\n\r\n### PROBLEMS \r\n\r\nAs in all codes we have some problems there I have them as well. \r\n\r\nThe first problem with which we encountered was that the bot was reading my ```GREETING_KEYWORDS``` as a one word so for example if the ```KEYWORD``` was \"GOOD EVENING\" bot only readed the good and he was not replaying anything, or we needed to change everything including ```GREETING_KEYWORDS``` like this. \r\n\r\n![mistake](photos/zodis.png)\r\n\r\nSo I founded that the function parameters was wrong because in \r\n\r\n```python\r\n def check_for_greeting(self, snetence)\r\n ```\r\n\r\nI was using not the ```sentence``` but the ```word``` so after that changes the code was working pretty fine.\r\n\r\nWorking along I found another small problem where the bot was replaying to its own messages which caused that \r\n\r\n![photo](photos/atprasymas.png)\r\n\r\n\r\n### WHAT IS NEXT?\r\n\r\nLater on I started with the actuall code \r\n\r\n``` EXAMPLE OF THE NLU BOT CODE```\r\n```python \r\ndef check_for_greeting(self, sentence):\r\n \"\"\"if user write anything from the greeting keyword, the bot response with greeting response\"\"\"\r\n if sentence.lower() in GREETING_KEYWORDS:\r\n return random.choice(GREETING_RESPONSES)\r\n if sentence.lower() in DOING_KEYWORDS:\r\n return random.choice(DOING_RESPONSES) + \", \" + random.choice(ASKING_ABOUT_YOU)\r\n```\r\n\r\nThere we take sentence which is wrote by the user and we use ```sentence.lower``` just to prevent our code if the user is writing with the CAPS LOCK. \r\n\r\nLater we are checking the input words and if we recognise some from our ```GREETING_KEYWORDS``` than bot replays to the user with random response from ```GREETING_RESPONCES``` also we do this the same with the ```DOING_KEYWORDS``` and ```DOING_RESPONCES```, but there we just add one more step in which bot asks about how the user is doing.\r\n\r\n## OUT OF MY COMFORT ZONE \r\n\r\nFor my next code I really needed to get out of my comfort zone and do what makes me a bit sick. I was reading a lot of pages how to use [API](https://medium.freecodecamp.org/what-is-an-api-in-english-please-b880a3214a82) but after two days of trying I give up. \r\n\r\nAfter considering I found how to use API in a bit [easier](http://www.icndb.com/api/?fbclid=IwAR3VajjKEy5ZFoMbp9lhnxA97T-CQz4ZKElZRXoaQNTcuA7iePNrVR-s4nI) way so I came along with some code \r\n\r\n```API CODE EXAMPLE```\r\n```python\r\ndef check_for_jokes(self, sentence):\r\n r = requests.get('https://api.icndb.com/jokes/random')\r\n data = r.json()\r\n ans = data[\"value\"][\"joke\"]\r\n if sentence.lower() in JOKES_KEYWORDS:\r\n return ans\r\n```\r\n\r\n# THE TEAM \r\n\r\n\r\nOur team had amazing scrum master [Declan Soper](https://www.linkedin.com/in/declan-soper-9b0637155/) which had a lot of useful knowledge in team managing which helped us a lot. \r\n## MEMBERS\r\nThe team was not that great, but it happens in real world so we had to deal with this problem. \r\n\r\nOne member quit the group or he was just not walking to the lectures another two was attending to some of the lectures but they was not working with the team and the communication with them was extremely hard. So we actually had the three members in our team. \r\n## WORKING WITH TEAM\r\nAt the team meetings we used team planning throught [azure](https://azure.microsoft.com/en-gb/free/search/?&OCID=AID719823_SEM_EnMuQWKU&lnkd=Google_Azure_Brand&dclid=CKqE6a2Q-t4CFTYj0wodMysECg) where at first we created a lots of files what we want to do for our team chatbot lately we attached the work for every team member \r\n\r\nTo make our work faster and easier we did [planning poker](https://play.planningpoker.com/play/game/cG9f1OFtpYQcDx8AKgv82GyMojAl8ezt) every week which helped us to consider how much time we will waste on different chatbot codes. \r\n\r\nAlso we used [github](https://github.coventry.ac.uk/) which helped to combine our codes together and also to have our codes anywhere we go.",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}
@@ -0,0 +1,138 @@
/*!
* GitHub Dark v0.3.0
* Copyright (c) 2012 - 2016 GitHub, Inc.
* Licensed under MIT (https://github.com/primer/github-syntax-theme-generator/blob/master/LICENSE)
*/

.pl-c /* comment, punctuation.definition.comment, string.comment */ {
color: #969896;
}

.pl-c1 /* constant, entity.name.constant, variable.other.constant, variable.language, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */,
.pl-s .pl-v /* string variable */ {
color: #0099cd;
}

.pl-e /* entity */,
.pl-en /* entity.name */ {
color: #9774cb;
}

.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */,
.pl-s .pl-s1 /* string source */ {
color: #ddd;
}

.pl-ent /* entity.name.tag */ {
color: #7bcc72;
}

.pl-k /* keyword, storage, storage.type */ {
color: #cc2372;
}

.pl-s /* string */,
.pl-pds /* punctuation.definition.string, source.regexp, string.regexp.character-class */,
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
.pl-sr /* string.regexp */,
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */,
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ {
color: #3c66e2;
}

.pl-v /* variable */,
.pl-smw /* sublimelinter.mark.warning */ {
color: #fb8764;
}

.pl-bu /* invalid.broken, invalid.deprecated, invalid.unimplemented, message.error, brackethighlighter.unmatched, sublimelinter.mark.error */ {
color: #e63525;
}

.pl-ii /* invalid.illegal */ {
color: #f8f8f8;
background-color: #e63525;
}

.pl-c2 /* carriage-return */ {
color: #f8f8f8;
background-color: #e63525;
}

.pl-c2::before /* carriage-return */ {
content: "^M";
}

.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
font-weight: bold;
color: #7bcc72;
}

.pl-ml /* markup.list */ {
color: #c26b2b;
}

.pl-mh /* markup.heading */,
.pl-mh .pl-en /* markup.heading entity.name */,
.pl-ms /* meta.separator */ {
font-weight: bold;
color: #264ec5;
}

.pl-mq /* markup.quote */ {
color: #00acac;
}

.pl-mi /* markup.italic */ {
font-style: italic;
color: #ddd;
}

.pl-mb /* markup.bold */ {
font-weight: bold;
color: #ddd;
}

.pl-md /* markup.deleted, meta.diff.header.from-file, punctuation.definition.deleted */ {
color: #bd2c00;
background-color: #ffecec;
}

.pl-mi1 /* markup.inserted, meta.diff.header.to-file, punctuation.definition.inserted */ {
color: #55a532;
background-color: #eaffea;
}

.pl-mc /* markup.changed, punctuation.definition.changed */ {
color: #ef9700;
background-color: #ffe3b4;
}

.pl-mi2 /* markup.ignored, markup.untracked */ {
color: #d8d8d8;
background-color: #808080;
}

.pl-mdr /* meta.diff.range */ {
font-weight: bold;
color: #9774cb;
}

.pl-mo /* meta.output */ {
color: #264ec5;
}

.pl-ba /* brackethighlighter.tag, brackethighlighter.curly, brackethighlighter.round, brackethighlighter.square, brackethighlighter.angle, brackethighlighter.quote */ {
color: #e1e1e1;
}

.pl-sg /* sublimelinter.gutter-mark */ {
color: #6e7880;
}

.pl-corl /* constant.other.reference.link, string.other.link */ {
text-decoration: underline;
color: #3c66e2;
}

0 comments on commit 0170169

Please sign in to comment.