Automatic knowledge classification based on keyword co-occurrrence network

Hope (Huang Tian-Yuan)


Short for automatic knowledge classification, akc is an R package used to carry out keyword classification based on network science (mainly community detection techniques), using bibliometric data. However, these provided functions are general, and could be extended to solve other tasks in text mining as well. Main functions are listed as below:


Generally provides a tidy framework of data manipulation supported by dplyr, akc was written in data.table when necessary to guarantee the performance for big data analysis. Meanwhile, akc also utilizes the state-of-the-art text mining functions provided by stringr,tidytext,textstem and network analysis functions provided by igraph,tidygraph and ggraph. Pipe %>% has been exported from magrittr and could be used directly in akc.

Logo of akc package.

Logo of akc package.


Load package and inspect data

The data set contains bibliometric data on topic of “academic library”,it is a data.frame of 4 columns(with docuent ID,article title,keyword and abstract), more information could be found via ?bibli_data_data.If the user want to carry out tasks by simply copying the example codes,make sure to arrange the data in the same format as biblio_data_table and set the same names for the corresponding columns.

Keyword cleaning

The entire cleaning processes include: 1.Split the text with separators; 2.Reomve the contents in the parentheses (including the parentheses); 3.Remove whitespaces from start and end of string and reduces repeated whitespaces inside a string; 4.Remove all the null character string and pure number sequences; 5.Convert all letters to lower case; 6.Lemmatization (not in default setting because it is not recommended unless you need a relatively rough result. For better merging, use keyword_merge displayed below).

Keyword merging

Merge keywords that have common stem or lemma, and return the majority form of the word.

Keyword grouping

Create a tbl_graph(a class provided by tidygraph package) from the tidy table with document ID and keyword. Each entry(row) should contain only one keyword in the tidy format.

Output the table of results

The output table would show the top 10 keywords (by occurrence) and their frequency. Keywords are separated by “;”.

Visualize the results

Keyword co-occurrence network in different groups. Colors are used to specify the groups, the size of nodes is proportional to the keyword frequency, while the alpha of edges is proportional to the co-occurrence relationship between keywords.

Keyword extraction from abstract

To extract keywords from the abstract using the keywords as a dictionary. More pre-processing filter should be implemented afterward, such as cleaning, keyword merging and filtering by term frequency or tf-idf. It is suggested to keep the size down before using keyword_group.