This research explores the psychological resilience of stay-at-home mothers facing work-family conflict using natural language processing (NLP) techniques. Through analyzing semi-structured interviews with 12 stay-at-home mothers, we examined how emotional resilience, behavioral resilience, and social support moderate work-family conflict, providing quantifiable insights into complex psychological phenomena.
Stay-at-home mothers represent a significant social group that often faces profound role conflicts between their educational responsibilities for children and personal career development. In China’s cultural context, where education is highly valued, these mothers experience unique psychological adaptation challenges as they navigate between family responsibilities and personal development.
The research integrates social cognitive theory with psychological resilience models, utilizing text data analysis methods and NLP technology to mine emotional expressions, cognitive patterns, and social support characteristics from interview texts.
A four-stage data analysis process was implemented:
# Stage 1: Data Preprocessing
def data_preprocessing(text_data):
"""Process interview text data through manual review, sentence segmentation, and word tagging"""
cleaned_data = manual_review(text_data) # Remove irrelevant content and ensure reliability
sentences = sentence_segmentation(cleaned_data) # Split text into grammatically coherent sentences
tagged_data = pos_tagging(sentences) # Identify grammatical units (nouns, verbs, etc.)
return tokenize_and_filter(tagged_data) # Break sentences into semantic units and remove stopwords
# Stage 2: Sentiment Analysis
def emotional_fluctuation_analysis(preprocessed_data):
"""Quantitatively assess emotional tendencies in the interview data"""
# Using VADER for sentiment scoring with Chinese optimization via BosonNLP
vader_analyzer = SentimentIntensityAnalyzer()
sentiment_scores = []
for text_segment in preprocessed_data:
scores = vader_analyzer.polarity_scores(text_segment)
# Combine with BosonNLP for Chinese text optimization
boson_score = boson_sentiment(text_segment)
combined_score = optimize_score(scores, boson_score)
sentiment_scores.append(combined_score)
# Track emotional changes throughout the interview
emotional_patterns = track_emotion_patterns(sentiment_scores)
return sentiment_scores, emotional_patterns
# Stage 3: Topic Modeling
def extract_topics(preprocessed_data):
"""Extract latent topics from interview text using NMF"""
# TF-IDF vectorization
vectorizer = TfidfVectorizer(
max_features=1000,
token_pattern=r"(?u)\b\w+\b",
stop_words=list(get_stopwords()),
min_df=2,
max_df=0.95
)
# Create TF-IDF matrix
tfidf_matrix = vectorizer.fit_transform(preprocessed_data)
# Apply NMF for topic extraction
nmf_model = NMF(
n_components=12, # 12 predefined topics based on research framework
random_state=42,
max_iter=500
)
topic_matrix = nmf_model.fit_transform(tfidf_matrix)
feature_names = vectorizer.get_feature_names_out()
# Extract topic words with weights
topic_words = []
for topic_idx, topic in enumerate(nmf_model.components_):
top_words_idx = topic.argsort()[:-15:-1]
top_words = [(feature_names[i], topic[i]) for i in top_words_idx]
topic_words.append(top_words)
return topic_matrix, topic_words
# Stage 4: Psychological Resilience Conceptualization
def map_resilience_indicators(topic_matrix, topic_words):
"""Map extracted topics to psychological resilience dimensions"""
# Map topics to emotional resilience, behavioral resilience, and social support dimensions
resilience_map = {
'emotional_resilience': ['love', 'feelings', 'difficulties', 'reflection'],
'behavioral_resilience': ['daily life', 'self-growth', 'work', 'goals', 'decision-making'],
'external_support': ['companionship and support', 'family', 'education']
}
# Calculate prevalence of resilience dimensions across interviews
resilience_prevalence = calculate_prevalence(topic_matrix, resilience_map)
return resilience_prevalence
We used the paraphrase-multilingual-MiniLM-L12-v2 model to generate semantic vector representations of interview texts, enabling us to capture implicit semantic relationships and deeper psychological patterns beyond explicit keywords.
Sentiment analysis revealed four typical emotional patterns among stay-at-home mothers:
Our NMF topic modeling identified 12 key topics that fell into three major categories:
Our analysis identified significant differences in how emotional resilience and behavioral resilience moderate work-family conflict:
Ongoing and future developments of this research include: