Purpose: To develop a generalizable Natural Language Processing (NLP) pipeline to extract physician-reported pain scores from consultation notes of cancer patients with bone metastasis. Methods: The texts of 1249 publicly-available hospital discharge notes in the i2b2 database were used as a training set. MetaMap and NegEx algorithms were implemented for pain terms extraction. Sets of NLP rules were developed to score pain terms in each note. By averaging pain scores, each note was assigned to one of the three pain scales, including no pain, pain, and undocumented pain. Without further training, the generalizability of our pipeline in scoring individual pain terms was tested independently using 30 hospital discharge notes from the MIMIC-III database and 30 consultation notes from our institution. Finally, 150 notes from our institution were used to assess the pipeline’s performance at assigning pain scales. Results: Our NLP pipeline scored individual pain terms in the i2b2 summary notes with 93% and 92% precision and recall, respectively. Testing on the MIMIC-III database achieved 91% precision and 86% recall. Testing on our institutional corpus achieved 89%, and 82% precision and recall. Finally, our pipeline assigned a pain scale to each note in our institutional corpus with 84% and 82% precision and recall. Conclusion: We developed a generalizable NLP pipeline to classify pain on independent datasets without retraining. This portable and ready-to-use pipeline can be used to automatically extract and classify physician-reported pain scores from clinical notes where the pain is not otherwise documented through structured data entry.