Skip to content

Instantly share code, notes, and snippets.

View loristns's full-sized avatar
🤔

Loris Nezan loristns

🤔
View GitHub Profile
@loristns
loristns / pretty_ecs_logs.py
Created November 26, 2024 13:41
Processes and formats ECS logs from stdin using rich
"""This script processes and formats ECS logs from stdin using rich"""
# /// script
# dependencies = ["rich"]
# ///
import json
import sys
import re
from datetime import datetime

Restaurant Bot dataset

Restaurant Bot is a chatbot taking orders for meals.

A meal is composed of a starter, a main dish and a dessert. Furthermore, you have a point system where you pay a fixed price of 8$ giving you 6 points you can spread across your meal.

There is several option for starter :

  • salad (-1 pt)
@loristns
loristns / password.md
Created April 9, 2020 14:03
I lost my password bot is a tiny bot helping people find their login back.

I lost my password bot

I lost my password bot is a tiny bot helping people find their login back. He can do the following actions :

  • introduce
  • sayHello
  • solved
  • sayGoodbye
  • checkSpell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loristns
loristns / GPT2.ipynb
Created February 19, 2019 12:08
Demo of OpenAI's GPT-2 algorithm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loristns
loristns / sentiment_analysis.py
Created June 28, 2018 17:21
Kadot Sentiment Analysis (Website)
from kadot.classifiers import BayesClassifier
# This is a tiny dataset collected on the title of IMDB reviews of "Star Wars: The Force Awakens"
train = {
"Star Wars fans win again": 'positive',
"Greatest movie of all time": 'positive',
"Yes, it really is that good.": 'positive',
"Beyond incredible!": 'positive',
"This is the best Star Wars movie ever.": 'positive',
"Far and way the greatest film of 2015.": 'positive',
@loristns
loristns / mini_bot.py
Created May 12, 2018 10:12
Kadot 1.0 Mini Bot
from kadot.bot_engine import ConversationNode
from kadot.models import EntityRecognizer
from kadot.vectorizers import VectorDict
import random
glove = VectorDict.load_glove(open('glove/glove.6B.50d.txt'))
city_recognizer = EntityRecognizer({
"I live in Paris ": ('Paris',),
"The city where I live is London": ('London',),
"in berlin, there is many things to do": ('berlin',),
@loristns
loristns / pytorch_cat_name.ipynb
Last active February 24, 2018 18:34
Generate cats names using PyTorch.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@loristns
loristns / pytorch_linear_regression.py
Last active February 14, 2018 19:02
PyTorch linear regression
import torch
from torch.autograd import Variable
from torch.nn import MSELoss
points = [
(0, 20),
(2, 16),
(6, 14),
(4, 10),
(10, 10),
@loristns
loristns / graph.py
Last active August 23, 2016 18:14
Markov using GraphInPy
from collections import Counter
def append_a_graph(graph_dict: dict, key: str, value) -> dict:
"""
Append a value into a graph
:param graph_dict: the Graph.dict value
:param key: the name of the point
:param value: the name of the point to add
:type value: set or list