# Is NLP or Machine Learning possible in Elm?

**URL:** <https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660>\
**Category:** Learn\
**Created:** [April 27, 2020, 1:55pm UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660 "2020-04-27T13:55:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmadsherzai](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ahmadsherzai/32/3320_2.png) [@ahmadsherzai](https://discourse.elm-lang.org/u/ahmadsherzai)\
**Post date:** [April 27, 2020, 1:55pm UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/1 "2020-04-27T13:55:17Z")

</div>

Hello all,

I will definitely look like a stupid to ask but I will.

I am just wondering if it is possible to solve some NLP or AI or Machine learning problems in Elm. for example, decide what can be a good response from an already defined set or list, for a request?

If yes, please guide me where should I start, or show me something if you have already done.

Or am I totally wrong about the language?

Thank You.

---

<div class="post-metadata">

**Author:** ![jackwilsdon](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jackwilsdon/32/2812_2.png) [@jackwilsdon](https://discourse.elm-lang.org/u/jackwilsdon)\
**Post date:** [April 27, 2020, 5:26pm UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/2 "2020-04-27T17:26:42Z")

</div>

It doesn’t look like the are any Elm packages for this right now (try searching [here](https://package.elm-lang.org/)), but there’s no reason that one couldn’t be implemented in Elm.

You could also look at using an existing JS library through [ports](https://guide.elm-lang.org/interop/ports.html) if you’re intent on using Elm for this.

It’s worth noting that Elm isn’t quite as performant as vanilla JS, so you might want to look elsewhere if you’re looking to implement something computationally complex.

---

<div class="post-metadata">

**Author:** ![ahmadsherzai](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ahmadsherzai/32/3320_2.png) [@ahmadsherzai](https://discourse.elm-lang.org/u/ahmadsherzai)\
**Post date:** [April 27, 2020, 7:23pm UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/3 "2020-04-27T19:23:44Z")

</div>

Thank you for the reply.

I am not implementing something complex, Just looking to train some data and then return it based on the best match.

Let’s say, I have data in a List composed of Strings (almost 100 sentences). Now I want to search for a specific words in the list. I want Elm to give me only those values which matches best.

Not sure, if I can do something like this in Elm to train a module to return only the best matches.

---

<div class="post-metadata">

**Author:** ![evancz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/evancz/32/16_2.png) [@evancz](https://discourse.elm-lang.org/u/evancz)\
**Post date:** [April 27, 2020, 10:20pm UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/4 "2020-04-27T22:20:14Z")

</div>

I know there has been exploration of data visualization with SVG in Elm packages, but I’d love to see the package ecosystem expand to cover data analysis as well! I think the tasks that @ahmadsherzai is describing could be an excellent fit for Elm!

When I was a student a decade ago, I remember implementing things like [Hidden Markov Model’s](https://en.wikipedia.org/wiki/Hidden_Markov_model), [clustering](https://en.wikipedia.org/wiki/Cluster_analysis), and [Support-Vector Machines](https://en.wikipedia.org/wiki/Support-vector_machine) in languages where visualization was much more difficult, and I think it would have been great to be able to pair these algorithms with a nice SVG that shows the clusters or regressions that come out!

I know the WebGL have techniques to get good performance for their physics simulations, so I’d be curious where we hit limits when it comes to data analysis. I suspect a lot of useful analyses can be implemented without any vector unpacking tricks, and you’d still get performance that’s more than enough for cases like @ahmadsherzai is describing!

I looked into this area a bunch in November, but ended up feeling like I wasn’t enough of a domain expert to really do this overall project justice. I was going to talk about my findings at Oslo Elm Day and ask the community to help take the next steps!

---

<div class="post-metadata">

**Author:** ![ahmadsherzai](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ahmadsherzai/32/3320_2.png) [@ahmadsherzai](https://discourse.elm-lang.org/u/ahmadsherzai)\
**Post date:** [April 28, 2020, 11:28am UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/5 "2020-04-28T11:28:52Z")

</div>

Thank you Evan for the reply and **THANK YOU FOR THE AWESOME LANGUAGE!**  
I would love to see someone starts working on these packages, ASAP. Please mention if we have data experts in our community.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [May 8, 2020, 11:40am UTC](https://discourse.elm-lang.org/t/is-nlp-or-machine-learning-possible-in-elm/5660/6 "2020-05-08T11:40:14Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
