Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

ntakokevin/Word-Count-and-Phrase-Analysis-of-Swahili-Language-Using-Spark-RDD

Domain:

natural language processing

Record type:

software
Creator:
nta
Host:
# Word-Count-and-Phrase-Analysis-of-Swahili-Language-Using-Spark-RDD In this project, our objective is to develop a word count function that performs phrase analysis using Spark RDD (Resilient Distributed Datasets). The main focus lies within the function "run_phrase_count_on_rdd()" where several transformations are applied to the RDD to generate phrase counts. The key steps involved in this process include filtering the RDD to skip header and bad rows, utilizing map operations to split each line into columns and convert text into n-grams using NLTK functions, employing flatMap to flatten the RDD for subsequent reduction, and finally, choosing between reduce or reduceByKey operations. Detailed information on these steps can be found in the Spark RDD API documentation and the "introducing-spark-APIs" notebook. Before executing the function, it is recommended to test the code for computing phrase counts independently. It is advisable to compute one transformation at a time and verify its correctness before chaining multiple operations together. Additionally, ensure that the function "tokenize_into_ngrams_phrase(text, n=3)" is functioning correctly by testing it before using it in the map operation. To explore the data and perform testing, loading the data into a pandas DataFrame is encouraged. The expected number of columns in the output CSV file is 3, namely phrase, count, and phrase_en, which will be checked during the grading process. ## Converting Texts into N-grams For generating n-grams effortlessly, we recommend using the NLTK module and specifically the "ngrams" function. Additionally, the "sent_tokenize" function from the "nltk.tokenize" module will be useful. Exploring the NLTK documentation will provide a better understanding of how to use these functions effectively. ## Cleaning up Phrases During tokenization, nonsensical and noisy phrases such as 0000 or blank strings may be generated. It is crucial to remove these from the results. You have the fl …

Visit

github.com

Languages

Swahili

Similar

Word Order of Noun Phrase by Modification in Mambwe LanguageAutshumato Multilingual Word and Phrase TranslationsWord-Level Language Identification and Predicting Codeswitching Points in Swahili-English Language DataA new English-Swahili phrase bookBetter Word Representation Vectors Using Syllabic Alphabet: A Case Study of SwahiliPrefixes and Suffixes and their Effect upon Word Structure in the Swahili Language

Word Order of Noun Phrase by Modification in Mambwe Language

Mambwe language is spoken in Mbala and Senga districts in Northern Province along the corridors of Z

Autshumato Multilingual Word and Phrase Translations

Word and phrase lists aligned from English to the other official South African languages.

Word-Level Language Identification and Predicting Codeswitching Points in Swahili-English Language Data

A new English-Swahili phrase book

Better Word Representation Vectors Using Syllabic Alphabet: A Case Study of Swahili

Deep learning has extensively been used in natural language processing with sub-word representation

Prefixes and Suffixes and their Effect upon Word Structure in the Swahili Language