<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>Clojure</anon>
  </categories>
  <description>自動文章生成の手法の一つとして昔から有名なのが、マルコフ連鎖でn-gramから次の単語を確率的に決めて行くやり方である。 元となる文章データから、n語の連なり（prefixと呼ばれる）の後に来る単語の確率分布を作る。 起点としてn語を用意し、確率分布に従ってn+1の位置の単語を決定。 2~n+2までの位置の語をprefixとして次の単語を決定 3~n+3までの... と一個ずつ位置をずらして続けていく。 Clojureだと比較的簡単にコードできそうだったので作ってみる。 まずはヘルパー関数二つ。 (defn map-vals [f hmap] (zipmap (keys hmap) (map …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2016%2F05%2F11%2F211951&quot; title=&quot;Clojureとマルコフ連鎖で自動文章生成 - Arantium Maestum&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-05-11 21:19:51</published>
  <title>Clojureとマルコフ連鎖で自動文章生成</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2016/05/11/211951</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
