The present invention is related to a method for ameliorating liver fibrosis in a subject. The present invention utilizes copolymers of polyethylene glycol and poly (D, L-lactide-co-glycolide) to form nanoparticle composition containing tyrosine kinase inhibitor, such as Sorafenib. The use of nanoparticle composition is non-toxic and can increase the stability and decrease the release of drug in blood circulation. The pharmaceutical composition is in an injectable form. The nanoparticle composition containing tyrosine kinase inhibitor of the present invention can effectively ameliorate liver fibrosis including decreasing extracellular matrix accumulation, suppressing hepatic stellate cell activity, shrinking of abnormal blood vessel, and lowering microvascular density in fibrotic liver; hence is suitable for clinical application for the treatment of liver fibrosis.