Skip to content

Instantly share code, notes, and snippets.

View JakubMifek's full-sized avatar
💭
I may be slow to respond.

Jakub Mifek JakubMifek

💭
I may be slow to respond.
View GitHub Profile
@JakubMifek
JakubMifek / quotes.py
Created January 22, 2022 13:55
quotes.py
quotes = ['"', '❞', '❝', '„', '“', '‟', '”', '”', '⹂']
desired_quotes = ('„', '“')
def fix_quotes(text: str) -> str:
text = text.replace(',,', '"')
text = text.replace("''", '"')
j = 0
T = [t for t in text]
for i in range(len(T)):

Hello, traveler o/

API

Option 1 - No path parameters (except CRUD)

POST /api/performance/v1/test-entities/action

  • cannot contain path parameters - collisions are unavoidable
  • ALL parameters are in query
  • CRUD operations are denoted with crud prefix (/api/performance/crud/v1/...)
  • CRUD may contain path parameters (they do not collide)

Option 2 - Header parameters

POST /api/performance/v1/test-entities/

#!/usr/bin/env python3
#
# All team solutions **must** list **all** members of the team.
# The members must be listed using their ReCodEx IDs anywhere
# in a comment block in the source file (on a line beginning with `#`).
#
# You can find out ReCodEx ID in the URL bar after navigating
# to your User profile page. The ID has the following format:
# 310a5c89-3ea1-11e9-b0fd-00505601122b
# 90257956-3ea2-11e9-b0fd-00505601122b
#!/usr/bin/env python3
import numpy as np
import tensorflow as tf
import decoder
from morpho_dataset import MorphoDataset
class Network:
def __init__(self, args, num_source_chars, num_target_chars):
class Model(tf.keras.Model):

Morpho

Batch:

  • forms
  • lemmas
  • tags

We have sentences and want to predict classes (nouns, verbs, ..)

  • we can specify mask which specifies number of words in sentence and "disables" parts of NN which will not be used (since we have less data). This will influence even the loss function
  • 1 for used place, 0 for not used (tf.keras.layers.Masking)

5. 4. 2019

Feature engineering - increases data dimensionality

jakub@Marvn:~/Projects$ lb4 project
? Project description: project
? Project root directory: project
? Application class name: ProjectApplication
? Select features to enable in the project Enable tslint, Enable prettier, Enable moch
a, Enable loopbackBuild, Enable vscode, Enable repositories, Enable services
create .npmrc
create .prettierignore
create .prettierrc
create DEVELOPING.md
attach(train)
m.tree <- rpart(mpg01 ~ ., train)
rpart.plot(m.tree)
prediction.m.tree <- predict(m.tree, test, type="class")
table(prediction.m.tree)
m.tree.cm <- table(prediction.m.tree, test$mpg01)
m.tree.cm
message("Accuracy = ", sum(diag(m.tree.cm))/78)
@JakubMifek
JakubMifek / filter.py
Last active September 26, 2018 14:02
Filter for snapshots
import io
import json
import sys
def tokenize(line):
return [token.strip() for token in line.split(':')]
def getSnapshot(line, idx, f):