Big Data Analysis of Meetup Events using Spark NLP, Kafka and Vegas Visualization | by andrei deuşteanu | Aug, 2020

Finding trending Meetup topics using Streaming Data, Named Entity Recognition and Zeppelin Notebooks — a tale of a super enthusiastic working group during the pandemic times

  • Determine which Meetup events attract the most responses within our region. Therefore we monitored the RSVPs for meetups based on certain tags, related to our domain of interest — Big Data.
  • RSVPs Distribution

The first 2 elements are common in both sets of visualizations. This is the part that reads data from the API and saves it in 2 Kafka Topics.

  1. For each RSVP, the Stream Reader script then fetches event data for it, only if the event_id does not exist in the events.idx file. This way we make sure that we read event data only once. The setup for the Stream Reader script can be found -> Install Kafka and fetch RSVPs

Trending Keywords

Trending Keywords Architecture

Detailed Explanation of the NER Pipeline

In order to annotate the data, we need to transform it into a certain format, from text to numbers, and then back to text.

  1. Then, we break the document into sentences using a SentenceDetector.
  2. After this we separate the text into smaller units by finding the boundaries of words using a Tokenizer.
  3. Next we remove HTML tags and numerical tokens from the text using a Normalizer.
  4. After the preparation and cleaning of the text we need to transform it into a numerical format, vectors. We use an English pre-trained WordEmbeddingsModel.
  5. Next comes the actual keyword extraction using an English NerDLModel Annotator. NerDL stands for Named Entity Recognition Deep Learning.
  6. Further on we need to transform the numbers back into a human readable format, a text. For this we use a NerConverter and save the results in a new column called entities.
  7. Before applying the model to our data, we need to run an empty training step. We use the fit method on an empty dataframe because the model is pretrained.
  8. Then we apply the pipeline to our data and select only the fields that we’re interested in.
  9. Finally we write the data in Kafka:TOPIC_KEYWORDS

RSVPs Distribution

RSVPs Distribution Arhitecture

We used a machine from Hetzner Cloud with the following specs — CPU: Intel Xeon E3–1275v5 (4 cores/8 threads), Storage: 2×480 GB SSD (RAID 0), RAM: 64GB

RSVPs Distribution

These visualizations are done on data between 8th of May 22:15 UTC and 4th of June 11:23 UTC.

As you can see, most of the RSVPs occur in the United States, but the city with the highest number of RSVPs is London.
As you can see, most of the RSVPs are in the largest cities of the country. This is probably due to the fact that companies tend to establish their offices here and therefore attract talent to these places.
* This was produced with Grafana using RSVP data processed in Spark and saved locally.
* This was produced with Grafana using RSVP data processed in Spark and saved locally.

Trending Keywords


This visualization is done on data from July.

All of these are mentioned in the published Notebooks as well.

  1. Spark NLP did not work for us in a Spark standalone local cluster installation (with local file system). Standalone Local Cluster means that the cluster runs on the same physical machine — Spark Cluster Manager & Workers. Such a setup does not need distributed storage such as HDFS. The workaround for us was to configure Zeppelin to use local Spark, local (*), meaning a non-distributed single-JVM deployment mode available in Zeppelin.
  2. Vegas plug-in could not be enabled initially. Running the github — %dep z.load(“{vegas-version}”) — recommendation always raised an error. The workaround was to add all the dependencies manually in /opt/spark/jars. These dependencies can be found when deploying spark shell with the Vegas library — /opt/spark/bin/spark-shell –packages
  3. Helium Zeppelin addon did not work/couldn’t be enabled. This too raised an error when enabling it from Zeppelin GUI in our configuration. We did not manage to solve this issue. That’s why we used only Vegas, although it does not support Map visualizations. In the end we got creative a bit — we exported the data and loaded it into Grafana for Map visualizations.
  4. The default retention policy for Kafka is 7 days. This means that data older than 1 week is deleted. For some of the topics we changed this setting, but for some we forgot to do this and therefore we lost the data. This affected our visualization for the Trending Keywords in Romania.
  • In the world of Big Data you need clarity around the questions you’re trying to answer before building the Data Architecture and then follow through the plan to make sure you’re still working according to those questions. Otherwise, you might end up with something that can’t do what you actually need. It sounds a pretty general statement and pretty “DOH, OBVIOUSLY”. Once we’ve seen the visualizations, we realized that we did not create the Kafka objects according to our initial per country keywords distribution visualization — e.g. we created the count aggregation per all countries, in the KEYWORDS_COUNTED Table. Combine this with the mistake of forgetting to change the Kafka retention period from the default 7 days, by the time we realized the mistake we had lost the historical data as well. Major learning point.
  • Data should be filtered in advance of the ML/NLP process — we should have removed some keywords that don’t exactly make sense such as “de”, “da”. In order to get more relevant insights maybe several rounds of data cleaning and extracting the keywords might be needed.
  • After seeing the final visualizations we should probably have filtered a bit more some of the obvious words. For example of course Zoom was the highest scoring keyword since by June everybody was running only online meetups mainly on Zoom.

Leave a Comment