Skip to content

Instantly share code, notes, and snippets.

View farizrahman4u's full-sized avatar
🏠
Working from home

Fariz Rahman farizrahman4u

🏠
Working from home
View GitHub Profile
// Targeted by JavaCPP version 1.5-SNAPSHOT: DO NOT EDIT THIS FILE
package org.bytedeco.cpython.global;
import org.bytedeco.cpython.*;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package org.bytedeco.cpython.global;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.nio.IntBuffer;
C:\java\jdk1.8.0_181\bin\java -ea -Ddtype=float -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\lib\idea_rt.jar=52192:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\plugins\junit\lib\junit-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.4\plugins\junit\lib\junit5-rt.jar;C:\java\jdk1.8.0_181\jre\lib\charsets.jar;C:\java\jdk1.8.0_181\jre\lib\deploy.jar;C:\java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\java\jdk1.8.0_181\jre\lib\ext\sunec.
from utils import load_data
from model import get_model
print("Loading data...")
(x_train, y_train), (x_test, y_test) = load_data()
print("Data laoded.")
print(x_train.shape)
import numpy as np
import json
from keras.utils import Progbar
# dictionary management
idx2word = {20000: '<UNK>'}
word2idx = {'<UNK>': 20000}
frequencies = {}
from keras.layers import *
from keras.models import *
from utils import max_len, max_words
def get_model():
model = Sequential()
model.add(Embedding(max_words, 128))
model.add(GRU(128))
model.add(Dense(1, activation='sigmoid'))

ML bootcamp recommended setup

Requirements

OS

  • Windows 10 / Ubuntu / MacOS

Text editor

from keras.preprocessing.sequence import pad_sequences
import numpy as np
import json
import random
# indexes
word2idx = {}
idx2word = {}
tag2idx = {}
idx2tag = {}
import json
with open('ner_dataset.csv', 'r') as f:
lines = f.readlines()
lines.pop(0)
lines.pop(0)
sentences = []
[100%] Linking CXX shared library libnd4jcpu.dll
cd /C/libnd4j/blasbuild/cpu/blas && /C/msys64/mingw64/bin/cmake.exe -E remove -f CMakeFiles/nd4jcpu.dir/objects.a
cd /C/libnd4j/blasbuild/cpu/blas && /C/msys64/mingw64/bin/ar.exe cr CMakeFiles/nd4jcpu.dir/objects.a "CMakeFiles/nd4jcpu.dir/cpu/NativeOps.cpp.obj" "CMakeFiles/nd4jcpu.dir/cpu/GraphExecutioner.cpp.obj" "CMak eFiles/nd4jcpu.dir/cpu/NativeOpExcutioner.cpp.obj" "CMakeFiles/nd4jcpu.dir/cpu/NDArray.cpp.obj" "CMakeFiles/nd4jcpu.dir/cpu/NDArrayFactory.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include/cnpy/cnpy.cpp.obj" "CMak eFiles/nd4jcpu.dir/Environment.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include/loops/cpu/broadcasting.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include/loops/cpu/indexreduce.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include /loops/cpu/random.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include/loops/cpu/reduce.cpp.obj" "CMakeFiles/nd4jcpu.dir/__/include/loops/cpu/scalar.cpp.obj" "