Skip to content

Commit

Permalink
修复::fix tang7 demo notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
oovm committed Aug 28, 2018
1 parent ea77f83 commit 4361531
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Models/WaifuSY-Tang.nb
Git LFS file not shown
8 changes: 5 additions & 3 deletions Training/Tang-RNN/Tang.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
(*这里应该填这个函数的介绍*)
(* ::Section:: *)
(*函数说明*)
ExampleFunction::usage = "这里应该填这个函数的说明,如果要换行用\"\\r\"\r就像这样";
Tang7::usage = "";
Tang7Line::usage = "";
Tang7LineRandom::usage = "";
(* ::Section:: *)
(*程序包正体*)
(* ::Subsection::Closed:: *)
Expand All @@ -47,7 +49,7 @@
Tang7LineRandom[char_String] := Block[
{state, next, head, top},
If[StringLength@char >= 8, Return[]];
state = NetStateObject[net];
state = NetStateObject[WaifuTang7];
next[str_, r_ : 50] := (
top = Association @@ state[str, {"TopProbabilities", r}];
top = KeyDrop[top, Characters[",。?兮" <> StringTake[str, -1]]];
Expand All @@ -56,7 +58,7 @@
head = Nest[next[#, 5$TangShiComplex]&, char, 7 - StringLength@char];
Nest[next[#, $TangShiComplex]&, head <> ",", 7] <> "。"
];
Options[Tang7] = {Line -> 8};
Options[Tang7] = {Line -> 8, Riffle -> True};
Tang7[char_, OptionsPattern[]] := Block[
{next, shi, line},
line = OptionValue[Line];
Expand Down
4 changes: 2 additions & 2 deletions Training/Tang-RNN/Tang.nb
Git LFS file not shown

0 comments on commit 4361531

Please sign in to comment.