ObjectiveTo develop natural language processing (NLP) solutions for identifying patients' unmet social needs to enable timely intervention.Patients and Methods: DesignRetrospective cohort study with review and annotation of clinical notes to identify unmet social needs, followed by using the annotations to develop and evaluate NLP solutions. Participants1,103 primary care patients seen at a large academic medical center during 6/1/2019-5/31/2021 and referred to a community health worker (CHW program). Clinical notes and portal messages of 200 age/sex-stratified patients were sampled for annotation of unmet social needs. SystemsTwo NLP solutions were developed and compared. The first solution employed similarity-based classification on top of sentences represented as semantic embedding vectors. The second solution involved designing of terms and patterns for identifying each domain of unmet social needs in the clinical text. MeasuresPrecision, recall, and f1-score of the NLP solutions. ResultsA total of 5,675 clinical notes and 475 portal messages were annotated, with an inter-annotator agreement of 0.938. The best NLP solution achieved an f1-score of 0.95 and was applied to the entire CHW-referred cohort (n=1,103), of whom >80% had at least one unmet social need within the 6 months prior to the first CHW referral. Financial strain and health literacy were the top two domains of unmet social needs across most of the sex/age strata. ConclusionClinical text contains rich information about patients’ unmet social needs. NLP can achieve good performance in identifying those needs for CHW referral and facilitate data-driven research on social determinants of health.