repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/preprocessing/onset_converter.py | """Create train label for onset model
"""
import json
import math
from enum import Enum
from pathlib import Path
from typing import Type
import numpy as np
import pandas as pd
from notes_generator.constants import AppName, FRAME, get_difficulty_type_enum
allowed_appname = [AppName.STEPMANIA, AppName.STEPMANIA_I, App... | 3,169 | 29.776699 | 99 | py |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/preprocessing/mel.py | """Create mel-spectrogram from audio
"""
import json
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
import librosa
import numpy as np
import pandas as pd
from notes_generator.constants import *
def _format(d):
if "." in d:
return float(d)
else:
return int(d)
de... | 5,082 | 28.9 | 98 | py |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/preprocessing/__init__.py | 0 | 0 | 0 | py | |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/prediction/predictor.py | import logging
from logging import getLogger
from typing import Callable, Dict, List, Optional
from typing import Tuple, Union
import numpy as np
import torch
from notes_generator.constants import (
FRAME,
MAX_THRESHOLD,
SMDifficultyType,
SMNotesType,
sm_init_threshold,
sm_max_notes,
sm_mi... | 12,884 | 29.246479 | 114 | py |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/prediction/onset_prediction.py | from typing import List, Optional, Tuple, Union
import numpy as np
import torch
from notes_generator.constants import ConvStackType
from notes_generator.models.beats import gen_beats_array
def predict(
model,
mel,
condition: int,
threshold: float = 0.5,
bpm_info: Optional[List[Tuple[Union[float,... | 1,516 | 28.173077 | 91 | py |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/prediction/__init__.py | 0 | 0 | 0 | py | |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/prediction/step_mania/__init__.py | 0 | 0 | 0 | py | |
AAAI-23.6040 | AAAI-23.6040-master/notes_generator/prediction/step_mania/midi.py | """Convert generated score of stepmania to midi format and write down.
"""
from collections import defaultdict
from enum import Enum
from typing import Callable, Dict, List, NamedTuple, Tuple, Union
import mido
import pandas as pd
from mido import Message, MetaMessage, MidiFile, MidiTrack
from notes_generator.consta... | 11,445 | 33.58006 | 106 | py |
idea.deploy | idea.deploy-master/__init__.py | 0 | 0 | 0 | py | |
idea.deploy | idea.deploy-master/papers/idpy-papers.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020-2022 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 4,700 | 40.60177 | 102 | py |
idea.deploy | idea.deploy-master/idpy/test.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 42,871 | 38.918063 | 106 | py |
idea.deploy | idea.deploy-master/idpy/__init__.py | 0 | 0 | 0 | py | |
idea.deploy | idea.deploy-master/idpy/CUDA/CUDA.py | """
Provides a minimal interface for the use of pycuda
methods names, if shared, match those of idpy.OpenCL.OpenCL class
"""
import pycuda as cu
import pycuda.driver as cu_driver
from collections import defaultdict
__author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), ma... | 3,414 | 33.494949 | 96 | py |
idea.deploy | idea.deploy-master/idpy/CUDA/__init__.py | 0 | 0 | 0 | py | |
idea.deploy | idea.deploy-master/idpy/LBM/SCFStencils.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 15,590 | 37.307125 | 96 | py |
idea.deploy | idea.deploy-master/idpy/LBM/test.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 16,683 | 44.709589 | 105 | py |
idea.deploy | idea.deploy-master/idpy/LBM/__init__.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020-2021 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 1,675 | 40.9 | 101 | py |
idea.deploy | idea.deploy-master/idpy/LBM/SCThermo.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 27,962 | 44.028986 | 159 | py |
idea.deploy | idea.deploy-master/idpy/LBM/LBM.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020-2021 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 63,528 | 39.464331 | 106 | py |
idea.deploy | idea.deploy-master/idpy/LBM/DQ.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 9,655 | 39.571429 | 96 | py |
idea.deploy | idea.deploy-master/idpy/IdpyCode/IdpyCode.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 24,531 | 40.230252 | 150 | py |
idea.deploy | idea.deploy-master/idpy/IdpyCode/IdpySims.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 6,976 | 39.097701 | 99 | py |
idea.deploy | idea.deploy-master/idpy/IdpyCode/IdpyConsts.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 3,611 | 33.730769 | 96 | py |
idea.deploy | idea.deploy-master/idpy/IdpyCode/IdpyMemory.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 8,649 | 34.892116 | 96 | py |
idea.deploy | idea.deploy-master/idpy/IdpyCode/__init__.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020-2021 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 6,974 | 32.373206 | 126 | py |
idea.deploy | idea.deploy-master/idpy/Utils/NpTypes.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 2,088 | 36.981818 | 96 | py |
idea.deploy | idea.deploy-master/idpy/Utils/ManageData.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 3,581 | 34.82 | 96 | py |
idea.deploy | idea.deploy-master/idpy/Utils/IsModuleThere.py | """
Provides a simple function to check whether a module is installed
in the system. Works with Python3
"""
import importlib
__author__ = "Matteo Lulli"
__copyright__ = "Copyright 2020, idea.deploy"
__credits__ = ["Matteo Lulli"]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "Matteo Lulli"
__email__ = "mat... | 1,035 | 25.564103 | 65 | py |
idea.deploy | idea.deploy-master/idpy/Utils/__init__.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020-2021 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 1,675 | 40.9 | 101 | py |
idea.deploy | idea.deploy-master/idpy/Utils/CustomTypes.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 1,952 | 35.166667 | 96 | py |
idea.deploy | idea.deploy-master/idpy/OpenCL/OpenCL.py | __author__ = "Matteo Lulli"
__copyright__ = "Copyright (c) 2020 Matteo Lulli (lullimat/idea.deploy), matteo.lulli@gmail.com"
__credits__ = ["Matteo Lulli"]
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),... | 5,722 | 36.900662 | 101 | py |
idea.deploy | idea.deploy-master/idpy/OpenCL/__init__.py | 0 | 0 | 0 | py | |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/main.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import time
import wiki2_config
import os
import sys
import argparse
import logging
from model import PTBModel
import ptb_reader
import ptb_config
import utils
def b... | 26,860 | 42.962357 | 138 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/dynamic_eval.py | import tensorflow as tf
import numpy as np
class DynamicEval(object):
def __init__(self, config, tvars, grads):
self._eps = config.dynamic_epsilon
self._config = config
self._tvars = tvars
self._grads = grads
self._step_size = config.dynamic_lr
self._decay = config... | 4,634 | 38.956897 | 130 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/model_estimator.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import random_ops
import numpy as np
import time
import ptb_reader
import... | 60,001 | 41.494334 | 353 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/runfile.py | import argparse
import os
import sys
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--ckpt_file", type=str, default=None, help="results' dir")
ap.add_argument("--start_layer", type=int, default=None, help="S3 Path. (haim folder is excluded)")
ap.add_argument("--model", type=str, default=N... | 2,024 | 41.1875 | 130 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/ptb_reader.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 5,758 | 34.99375 | 117 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/ptb_config.py | class MosGLConfig(object):
forget_bias_init = 0.0
init_scale = 0.04
embed_init_scale = 0.1
batch_size = 40
bptt = 70
hid_size = [850] * 3
embedding_size = 280
vocab_size = 10000
layers = 3
seed = 570164
opt = "asgd"
opt_eps = 1e-5
opt_inverse_type = "add"
collect... | 983 | 17.923077 | 57 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/optimizers.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import logging
import re
logger = logging.getLogger("logger")
def clip_by_layer(updates, clip_norms):
clipped_updates = list()
for update, tvar in zip(updates, tf.trainable_vari... | 9,517 | 33.485507 | 123 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/wiki2_config.py | class MosGLConfig(object):
forget_bias_init = 0.0
init_scale = 0.04
embed_init_scale = 0.1
batch_size = 40
bptt = 70
hid_size = [950] * 3
embedding_size = 300
vocab_size = 33278
layers = 3
seed = 570164
opt = "asgd"
opt_eps = 1e-5
opt_inverse_type = "add"
collect... | 983 | 17.923077 | 57 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/utils.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import ast
import re
import os
import logging
logger = logging.getLogger("logger")
def tvars_num():
logger.info("model variables:")
nvars = 0
for var in ... | 4,226 | 29.630435 | 123 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import random_ops
import rnn_cell_additions as dr
import optimizers
impor... | 19,610 | 43.168919 | 121 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/finetune.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import time
from tensorflow_impl import wiki2_config
import os
import sys
import argparse
import logging
from tensorflow_impl.model import PTBModel
from tensorflow_imp... | 25,934 | 42.442211 | 138 | py |
gradual-learning-rnn | gradual-learning-rnn-master/tensorflow_impl/rnn_cell_additions.py | import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import random_ops
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.ops.rnn_cell_impl import BasicLSTMCe... | 10,730 | 45.25431 | 154 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/main.py | import argparse
import os
import time
import math
import ast
import numpy as np
import torch
import torch.nn as nn
import gc
import data
import model
from utils import batchify, get_batch, repackage_hidden, create_exp_dir, save_checkpoint
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank/WikiText2... | 17,738 | 42.584767 | 164 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/run-wikitext2.py | ###############################################################################
# GL-LWGC-LSTM
###############################################################################
# WikiText-2 word-level language modeling state-of-the-art training code
# code is based on open source implementation of MoS article:
# https://... | 8,978 | 31.89011 | 88 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/evaluate.py | import argparse
import os
import time
import math
import csv
import ast
import pickle
import numpy as np
import torch
import torch.nn as nn
import data
import model
from utils import batchify, get_batch, repackage_hidden
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank/WikiText2 RNN/LSTM Language M... | 17,935 | 40.614849 | 132 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/dynamiceval.py | import argparse
import time
import math
import numpy as np
import os
import csv
import torch
import pickle
import torch.nn as nn
from torch.autograd import Variable
import data
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model')
parser.add_argument('--data', type=str, default=... | 14,131 | 32.251765 | 130 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/generate.py | ###############################################################################
# Language Modeling on Penn Tree Bank
#
# This file generates new sentences sampled from the language model
#
###############################################################################
import argparse
import torch
from torch.autograd... | 2,610 | 33.813333 | 88 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/locked_dropout.py | import torch
import torch.nn as nn
from torch.autograd import Variable
class LockedDropout(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, dropout=0.5):
if not self.training or not dropout:
return x
m = x.data.new(1, x.size(1), x.size(2)).bernoulli_(... | 522 | 29.764706 | 71 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/utils.py | import os, shutil
import torch
from torch.autograd import Variable
def repackage_hidden(h):
"""Wraps hidden states in new Variables, to detach them from their history."""
if type(h) == Variable:
return Variable(h.data)
else:
return tuple(repackage_hidden(v) for v in h)
def batchify(data, b... | 1,845 | 36.673469 | 87 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/model.py | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from embed_regularize import embedded_dropout
from locked_dropout import LockedDropout
from weight_drop import WeightDrop
class RNNModel(nn.Module):
"""Container module with an encoder, a recurrent m... | 4,848 | 36.3 | 139 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/logger.py | # Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
import tensorflow as tf
import numpy as np
import scipy.misc
try:
from StringIO import StringIO # Python 2.7
except ImportError:
from io import BytesIO # Python 3.x
class Logger(object):
def __init__(self, log_dir):... | 2,449 | 33.027778 | 89 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/data.py | import os
import torch
from collections import Counter
class Dictionary(object):
def __init__(self):
self.word2idx = {}
self.idx2word = []
self.counter = Counter()
self.total = 0
def add_word(self, word):
if word not in self.word2idx:
self.idx2word.append(... | 3,989 | 29.692308 | 80 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/finetune.py | import argparse
import ast
import time
import math
import numpy as np
np.random.seed(331)
import torch
import torch.nn as nn
import data
import model
import os
from utils import batchify, get_batch, repackage_hidden, save_checkpoint
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank/WikiText2 RNN/LST... | 14,244 | 42.696319 | 132 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/weight_drop.py | import torch
from torch.nn import Parameter
from functools import wraps
class WeightDrop(torch.nn.Module):
def __init__(self, module, weights, dropout=0, variational=False):
super(WeightDrop, self).__init__()
self.module = module
self.weights = weights
self.dropout = dropout
... | 3,199 | 31 | 94 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/run-ptb.py | ###############################################################################
# GL-LWGC-LSTM
###############################################################################
# PennTreebank word-level language modeling state-of-the-art training code
# code is based on open source implementation of MoS article:
# https:... | 8,938 | 31.505455 | 88 | py |
gradual-learning-rnn | gradual-learning-rnn-master/pytorch_impl/embed_regularize.py | import numpy as np
import torch
from torch.autograd import Variable
def embedded_dropout(embed, words, dropout=0.1, scale=None):
if dropout:
mask = embed.weight.data.new().resize_((embed.weight.size(0), 1)).bernoulli_(1 - dropout).expand_as(embed.weight) / (1 - dropout)
mask = Variable(mask)
masked_embe... | 1,089 | 24.952381 | 133 | py |
sequer | sequer-main/code/SODatasetExtraction/question_answer_content_extraction.py | import json
from os.path import join
from lxml import etree
PROJECT_PATH = '../../'
postsXML = etree.iterparse(join(PROJECT_PATH, 'data', 'Posts.xml'), encoding="utf-8")
with open(join(PROJECT_PATH, 'data', 'ID2ContentPost.json'), mode="r", encoding="utf-8") as fr:
ID2ContentPost = dict(json.load(fr))
with open(... | 2,788 | 30.693182 | 95 | py |
sequer | sequer-main/code/eval/evalGecFromPkl.py | import pickle
import gc
import os
import Levenshtein
import numpy as np
from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction, sentence_bleu
from nltk.translate.chrf_score import corpus_chrf, sentence_chrf
from rouge import Rouge
from os.path import join
PROJECT_PATH = '../../'
path = join(PROJECT_PATH... | 5,954 | 40.354167 | 120 | py |
sequer | sequer-main/code/eval/sequer/evalSequer.py | import random
import Levenshtein
import numpy as np
import sys
from os.path import join
from nltk.corpus import stopwords
from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction, sentence_bleu
from nltk.translate.chrf_score import corpus_chrf, sentence_chrf
from rouge import Rouge
PROJECT_PATH = '../../'
... | 7,518 | 35.678049 | 138 | py |
sequer | sequer-main/code/eval/google/google.py | import pickle
import gc
import requests
import yaml
from os.path import join
GREEDY_MODE = 'greedy'
PROJECT_PATH = '../../'
with open(join(PROJECT_PATH, 'data', GREEDY_MODE + 'RMHardKeywordList.bin'), mode="rb") as fr:
sspList = list(pickle.load(fr))
# 525398
reqUrl = 'http://google.com/complete/search'
gCnt =... | 1,687 | 25.375 | 104 | py |
sequer | sequer-main/code/eval/hredqs/evalHredqs.py | import random
import Levenshtein
import numpy as np
from os.path import join
from nltk.corpus import stopwords
from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction, sentence_bleu
from nltk.translate.chrf_score import corpus_chrf, sentence_chrf
from rouge import Rouge
PROJECT_PATH = '../../../'
BEAM_SIZ... | 6,444 | 33.837838 | 120 | py |
sequer | sequer-main/code/eval/hredqs/genTrainTest.py | import pickle
import random
import json
from os.path import join
PROJECT_PATH = '../../../'
GREEDY_MODE = 'greedy'
fr_x = open(join(PROJECT_PATH, 'model', 'tensor2tensor-master', 'QueryReformulation', 'bpedata', 'train_x.bpe.txt'),
mode="r", encoding='utf-8')
fr_y = open(join(PROJECT_PATH, 'model', 'tens... | 1,708 | 41.725 | 116 | py |
sequer | sequer-main/code/eval/hredqs/ModelOutput2Format.py | import json
from os.path import join
PROJECT_PATH = '../../../'
fr = open(join(PROJECT_PATH, 'result', 'hredqs', 'v3hredqs_test.json'), mode="r", encoding='utf-8')
fw_input = open(join(PROJECT_PATH, 'result', 'hredqs', 'v3hredqs_input.txt'), mode="w", encoding='utf-8')
fw_output = open(join(PROJECT_PATH, 'result', '... | 916 | 38.869565 | 107 | py |
sequer | sequer-main/code/eval/languageTool/languageToolPklGen.py | import pickle
import gc
import requests
import json
GREEDY_MODE = 'greedy'
with open(GREEDY_MODE + 'RMHardKeywordList.bin', mode="rb") as fr:
sspList = list(pickle.load(fr))
gCnt = 0
tmpStorage = []
for ssp in sspList:
groundTruth = (' '.join(ssp[-2].split())).strip()
if gCnt >= 65103:
break
... | 2,308 | 31.521127 | 99 | py |
sequer | sequer-main/code/SSPExtraction/query2post.py | import pickle
import random
import json
from os.path import join
PROJECT_PATH = '../../'
GREEDY_MODE = 'greedy'
with open(join(PROJECT_PATH, 'data', GREEDY_MODE + 'RMHardKeywordList.bin'), mode="rb") as fr:
SSPList = list(pickle.load(fr))
with open(join(PROJECT_PATH, 'data', 'questionContent.json'), mode="r", en... | 1,059 | 27.648649 | 102 | py |
sequer | sequer-main/code/SSPExtraction/sspExtraction.py | import json
import pickle
import pandas as pd
import numpy as np
import datetime
from os.path import join
from urllib import parse
from nltk import word_tokenize
from nltk.corpus import stopwords
PROJECT_PATH = '../../'
PREVIEW_MODE = False
GREEDY_MODE = True
MIN_QUERY_LENGTH = 2
with open(join(PROJECT_PATH, 'data',... | 7,194 | 35.155779 | 122 | py |
sequer | sequer-main/code/tensor2tensor/setup.py | """Install tensor2tensor."""
from setuptools import find_packages
from setuptools import setup
setup(
name='tensor2tensor',
version='1.14.1',
description='Tensor2Tensor',
author='Google Inc.',
author_email='no-reply@google.com',
url='http://github.com/tensorflow/tensor2tensor',
license='Ap... | 3,012 | 29.434343 | 84 | py |
sequer | sequer-main/code/tensor2tensor/__init__.py | 0 | 0 | 0 | py | |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/problems_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 956 | 28 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/problems.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,006 | 28.617647 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/__init__.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 606 | 36.9375 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/problems_colab.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,057 | 27.594595 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/rendered_env_problem_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,803 | 38.492958 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/env_problem.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 21,307 | 31.58104 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/gym_env_problem_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 14,920 | 33.06621 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/time_step.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,736 | 34.545455 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/gym_spaces_utils.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 3,285 | 27.824561 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/gym_spaces_utils_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,062 | 33.383333 | 76 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/mujoco_problems_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,939 | 32.448276 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/tic_tac_toe_env_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,583 | 30.13253 | 78 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/trajectory_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 19,691 | 33.730159 | 82 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/time_step_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,881 | 29.852459 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/__init__.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 934 | 36.4 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/env_problem_utils_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 3,604 | 34.343137 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/env_problem_utils.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 9,598 | 35.086466 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/gym_env_problem.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 11,307 | 33.793846 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/tic_tac_toe_env_problem.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,691 | 28.684211 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/rendered_env_problem.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 5,121 | 36.386861 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/trajectory.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 21,085 | 35.544194 | 104 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/tic_tac_toe_env.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 7,146 | 28.171429 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/tic_tac_toe_env_problem_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,533 | 33.243243 | 87 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/envs/mujoco_problems.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,035 | 27.676056 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/image_transformer_2d.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 27,996 | 29.8337 | 88 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/vanilla_gan.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 8,032 | 35.848624 | 79 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/transformer_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 15,055 | 34.013953 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/lstm.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 19,917 | 37.01145 | 80 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/bytenet_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,811 | 32.555556 | 74 | py |
sequer | sequer-main/code/tensor2tensor/tensor2tensor/models/neural_gpu_test.py | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 2,166 | 33.951613 | 74 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.