Count words in string and tally up the repetitive words
Just finished that exercise too.
I think you can extract some of that logic to anonymous functions.
It isolates a pieces of behaviour that you can work on.

defmodule Words do
  @doc """
  Count the number of words in the sentence.

  Words are compared case-insensitively.
  """
  @spec count(String.t) :: map
  def count(sentence) do
    filter_word = fn(word) -&gt;
      String.match?(word, ~r/[a-zA-z\d]/)
    end

    remove_special_characters = fn(word) -&gt;
      String.replace(word, ~r/[:!&amp;@$%^,]/, "")
    end

    count_words = fn({k, v}, acc) -&gt;
      Map.put(acc, k, Enum.count(v))
    end

    sentence
    |&gt; String.downcase
    |&gt; String.split(~r/[\s_]/)
    |&gt; Enum.filter(filter_word)
    |&gt; Enum.map(remove_special_characters)
    |&gt; Enum.group_by(fn(word) -&gt; word end)
    |&gt; Enum.reduce(%{}, count_words)
  end

end


And actually, I've created a function that returns a list of words to count: http://exercism.io/submissions/e26667aff3734da79ac0b6c6fedfd3da

Hope that helps!