# Path: data/common.py
# MODEL_DIR = '/path/to/model/'
# 
# Path: data/wiki9.py
# def split_wiki9_articles(exp_id=0):
#   all_docs = list(os.listdir(WIKI9_DIR))
# 
#   s = gen_seed(exp_id)
#   random.seed(s)
#   random.shuffle(all_docs)
#   random.seed()
# 
#   n = len(all_docs) // 2
#   return all_docs[:n], all_docs[n:]
# 
# class WIKI9Articles(object):
#   def __init__(self, docs, dirname=WIKI9_DIR, verbose=0):
#     self.docs = docs
#     self.dirname = dirname
#     self.verbose = verbose
# 
#   def __iter__(self):
#     for fname in tqdm.tqdm(self.docs) if self.verbose else self.docs:
#       for line in smart_open.open(os.path.join(self.dirname, fname),
#                                   'r', encoding='utf-8'):
#         yield line.split()


from absl import flags
from absl import app
from gensim.models import Word2Vec, FastText
from glove import Corpus, Glove
from data.common import MODEL_DIR
from data.wiki9 import split_wiki9_articles, WIKI9Articles
import logging
import os
# Copyright 2019 Google LLC
#
# 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 law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



flags.DEFINE_integer('exp_id', 0, 'Experiment trial number')
flags.DEFINE_string('model', 'w2v', 'Word embedding model')

# Path: data/common.py
# MODEL_DIR = '/path/to/model/'
# 
# Path: data/wiki9.py
# def split_wiki9_articles(exp_id=0):
#   all_docs = list(os.listdir(WIKI9_DIR))
# 
#   s = gen_seed(exp_id)
#   random.seed(s)
#   random.shuffle(all_docs)
#   random.seed()
# 
#   n = len(all_docs) // 2
#   return all_docs[:n], all_docs[n:]
# 
# class WIKI9Articles(object):
#   def __init__(self, docs, dirname=WIKI9_DIR, verbose=0):
#     self.docs = docs
#     self.dirname = dirname
#     self.verbose = verbose
# 
#   def __iter__(self):
#     for fname in tqdm.tqdm(self.docs) if self.verbose else self.docs:
#       for line in smart_open.open(os.path.join(self.dirname, fname),
#                                   'r', encoding='utf-8'):
#         yield line.split()


# Path: train_word_embedding.py
from absl import flags
from absl import app
from gensim.models import Word2Vec, FastText
from glove import Corpus, Glove
from data.common import MODEL_DIR
from data.wiki9 import split_wiki9_articles, WIKI9Articles
import logging
import os

# Copyright 2019 Google LLC
#
# 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 law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



flags.DEFINE_integer('exp_id', 0, 'Experiment trial number')
flags.DEFINE_string('model', 'w2v', 'Word embedding model')

flags.DEFINE_string('save_dir', os.path.join(MODEL_DIR, 'w2v'),