- ..
- app_spec-checkpoint.yml
- char_rnn_model-checkpoint.py
- config_poem-checkpoint.py
- data_loader-checkpoint.py
- faas_requirements-checkpoint.txt
- handler-checkpoint.py
- intro-checkpoint.ipynb
- main-checkpoint.ipynb
- OVERVIEW-checkpoint.md
- rhyme_helper-checkpoint.py
- test-checkpoint.ipynb
- train-checkpoint.py
- Untitled-checkpoint.ipynb
- untitled-checkpoint.md
- Untitled1-checkpoint.ipynb
- word2vec_helper-checkpoint.py
- write_poem-checkpoint.py
Untitled-checkpoint.ipynb @master — view markup · raw · history · blame
In [1]:
from handler import handle
In [2]:
conf = {'体裁':'五言', 'style':'藏头诗', 'Chinese_word':'一二三四'}
res = handle(conf)
In [3]:
res
Out[3]:
In [23]:
res1 = res['Poetry'].split('。')[:2]
In [29]:
res1 = res['Poetry'].split('。')[:2]
res2 = []
for i in res1:
res2.extend(i.split(','))
res3 = res2[0]+',\n'+res2[1]+'。\n'+res2[2]+',\n'+res2[3]+'。'
In [30]:
res2
Out[30]:
In [35]:
res3 = res2[0]+',\n'+res2[1]+'。\n'+res2[2]+',\n'+res2[3]+'。'
print(res3)
In [1]:
# You can use other public modules via our Client object with module's identifier
# and parameters.
# For more detailes, please see our online document - https://momodel.github.io/docs/#
import os
import sys
# Define root path
sys.path.append('../')
# Import necessary packages
from modules import json_parser
from modules import Client
# Initialise Client object
client = Client(api_key='33799e1c5d6fa05fdd7dec3aa7aad868445d1c737edcf9c37fa89cb3b39cb2d9',
project_id='5bfd118f1afd942b66b36b30', user_ID='yangsaisai',
project_type='app', source_file_path='Untitled.ipynb')
# Make run/train/predict command alias for further use
run = client.run
train = client.train
predict = client.predict
# Make controller alias for further use
controller = client.controller
In [2]:
ls /home/jovyan/work/datasets/yangsaisai-poetrydatasets
In [ ]: