<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Load data
Step1:  Build feature matrix
The matrix is a JD-Skill matrix where each entry $e(d, s)$ is the number of times skill $s$ occurs in job description $d$.
Step2:  Get skills in each JD
Using the matrix, we can retrieve skills in each JD.
Step3:  Extract features of new documents
<ASSISTANT_TASK:>
Python Code:
HOME_DIR = 'd:/larc_projects/job_analytics/'; DATA_DIR = HOME_DIR + 'data/clean/'
RES_DIR = HOME_DIR + 'results/'
skill_df = pd.read_csv(DATA_DIR + 'skill_index.csv')
Explanation: Load data
End of explanation
doc_skill = buildDocSkillMat(jd_docs, skill_df, folder=DATA_DIR)
with(open(DATA_DIR + 'doc_skill.mtx', 'w')) as f:
    mmwrite(f, doc_skill)
Explanation: Build feature matrix
The matrix is a JD-Skill matrix where each entry $e(d, s)$ is the number of times skill $s$ occurs in job description $d$.
End of explanation
extracted_skill_df = getSkills4Docs(docs=doc_index['doc'], doc_term=doc_skill, skills=skills)
df = pd.merge(doc_index, extracted_skill_df, left_index=True, right_index=True)
print(df.shape)
df.head()
df.to_csv(DATA_DIR + 'doc_index.csv') # later no need to extract skill  again
Explanation: Get skills in each JD
Using the matrix, we can retrieve skills in each JD.
End of explanation
reload(ja_helpers)
from ja_helpers import *
# load frameworks of SF as docs
pst_docs = pd.read_csv(DATA_DIR + 'SF/pst.csv')
pst_docs
pst_skill = buildDocSkillMat(pst_docs, skill_df, folder=None)
with(open(DATA_DIR + 'pst_skill.mtx', 'w')) as f:
    mmwrite(f, pst_skill)
Explanation: Extract features of new documents
End of explanation
<END_TASK>