Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 2 | |
| jobs: | |
| build: | |
| docker: | |
| - image: circleci/ruby:2.5-node-browsers | |
| environment: | |
| RAILS_ENV: test | |
| # https://circleci.com/docs/2.0/faq/#how-can-i-set-the-timezone-in-docker-images | |
| TZ: "/usr/share/zoneinfo/Asia/Tokyo" | |
| - image: circleci/postgres:10-alpine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gensim | |
| import numpy as np | |
| import csv | |
| from scipy import spatial | |
| class SearchSimilarWords(): | |
| def __init__(self, words_csv_path, target_index, model_path): | |
| self.num_features = 300 | |
| self.words_array = self.build_words_array(words_csv_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # execute this to activate box strage | |
| !apt-get install davfs2 | |
| !echo https://dav.box.com/dav [BOXのEmail] [BOXのパスワード] >> /etc/davfs2/secrets | |
| !mkdir /content/box_dir | |
| !mount -t davfs https://dav.box.com/dav/ /content/box_dir |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'fiddle' | |
| require 'fiddle/import' | |
| module Julia | |
| extend Fiddle::Importer | |
| # Linux | |
| dlload Fiddle.dlopen('libjulia.so.0.6') | |
| typealias "uint8_t", "unsigned char" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using JSON | |
| using Images | |
| json = JSON.parsefile("./input/train.json") | |
| iamges_json = json["images"][1:10] | |
| for image_json in iamges_json | |
| try | |
| t = tempname() | |
| download(image_json["url"][1], t) | |
| img = load(t) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.