Using Neo4j for Knowledge Graph Construction in Enterprise NLP
Keywords:
knowledge graph, Neo4j, Cypher, enterprise NLP, named entity recognition, relation extraction, entity resolution, GraphRAGAbstract
Unstructured text contains significant knowledge—contracts, support tickets, policy documents—that makes cross-document factual queries difficult. This research describes a pipeline that constructs an enterprise knowledge graph in Neo4j from 12,400 documents using transformer-based named entity recognition, relation extraction, and entity resolution. Extraction, performance, and question-answering capabilities of the pipeline were examined. Fine-tuned recognizer achieved a micro F1 score of 0.91, relation extraction a macro/average F1 of 0.83, and entity resolution a pairwise F1 of 0.92, aggregating 241,000 mentions into 184,200 nodes interrelated by 612,500 relationships. Queries of five hops in Neo4j were executed in 171 ms, compared to 118 seconds with relational joins. Hybrid graph-and-vector retrieval for 200 multi-hop questions had a correct response rate of 79.5%, compared to 50.5% for vector retrieval (p < 0.001). Thus, Neo4j-based graph construction turns unstructured enterprise text into a queryable resource that facilitates multi-hop reasoning.References
Christophides, V., Efthymiou, V., Palpanas, T., Papadakis, G., & Stefanidis, K. (2020). An overview of end-to-end entity resolution for big data. ACM Computing Surveys, 53(6), Article 127.
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. Proceedings of NAACL-HLT, 4171–4186.
Francis, N., Green, A., Guagliardo, P., et al. (2018). Cypher: An evolving query language for property graphs. Proceedings of the ACM SIGMOD International Conference on Management of Data, 1433–1445.
Hogan, A., Blomqvist, E., Cochez, M., et al. (2021). Knowledge graphs. ACM Computing Surveys, 54(4), Article 71.
Ji, S., Pan, S., Cambria, E., Marttinen, P., & Yu, P. S. (2022). A survey on knowledge graphs: Representation, acquisition, and applications. IEEE Transactions on Neural Networks and Learning Systems, 33(2), 494–514.
Lewis, P., Perez, E., Piktus, A., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33, 9459–9474.
Nickel, M., Murphy, K., Tresp, V., & Gabrilovich, E. (2016). A review of relational machine learning for knowledge graphs. Proceedings of the IEEE, 104(1), 11–33.
Pan, S., Luo, L., Wang, Y., Chen, C., Wang, J., & Wu, X. (2024). Unifying large language models and knowledge graphs: A roadmap. IEEE Transactions on Knowledge and Data Engineering, 36(7), 3580–3599.
Robinson, I., Webber, J., & Eifrem, E. (2015). Graph databases: New opportunities for connected data (2nd ed.). O'Reilly Media.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.



