index.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. /**
  2. * Copyright (c) 2017-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the MIT license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. const React = require("react");
  9. const CompLibrary = require("../../core/CompLibrary.js");
  10. const Marked = CompLibrary.Marked; /* Used to read markdown */
  11. const Container = CompLibrary.Container;
  12. const GridBlock = CompLibrary.GridBlock;
  13. const siteConfig = require(process.cwd() + "/siteConfig.js");
  14. class Button extends React.Component {
  15. render() {
  16. return (
  17. <div className="pluginWrapper buttonWrapper">
  18. <a className="button" href={this.props.href} target={this.props.target}>
  19. {this.props.children}
  20. </a>
  21. </div>
  22. );
  23. }
  24. }
  25. Button.defaultProps = {
  26. target: "_self"
  27. };
  28. // head of the page
  29. class HomeSplash extends React.Component {
  30. render() {
  31. return (
  32. <div className="homeContainer">
  33. <div className="homeSplashFade">
  34. <div className="wrapper homeWrapper">
  35. <div className="inner">
  36. <img src={siteConfig.baseUrl + siteConfig.mainImg} width="50%"/>
  37. <h2 className="projectTitle">
  38. <small>{siteConfig.tagline}</small>
  39. </h2>
  40. <div className="section promoSection">
  41. <div className="promoRow">
  42. <div className="pluginRowBlock">
  43. <Button
  44. href={
  45. siteConfig.baseUrl + "docs/" + this.props.language + "/support.html"
  46. }
  47. >
  48. Get Started
  49. </Button>
  50. <Button
  51. href={
  52. siteConfig.baseUrl + "docs/" + this.props.language + "/english-vectors.html"
  53. }
  54. >
  55. Download Models
  56. </Button>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. );
  65. }
  66. }
  67. class Index extends React.Component {
  68. render() {
  69. let language = this.props.language || "en";
  70. const showcase = siteConfig.users
  71. .filter(user => {
  72. return user.pinned;
  73. })
  74. .map(user => {
  75. return (
  76. <a href={user.infoLink}>
  77. <img src={user.image} title={user.caption} />
  78. <br/>
  79. {user.caption}
  80. </a>
  81. );
  82. });
  83. return (
  84. <div>
  85. <HomeSplash language={language} />
  86. <div className="mainContainer">
  87. <div className="descriptionSection paddingTop lightBackground" style={{ textAlign: "left" }} id="fast-download">
  88. <Container>
  89. <GridBlock align="center"
  90. contents={[
  91. {
  92. content: "FastText is an open-source, free, lightweight library that allows users to learn text representations and text classifiers. It works on standard, generic hardware. Models can later be reduced in size to even fit on mobile devices.",
  93. title: "What is fastText?",
  94. }
  95. ]}
  96. layout="twoColumn"
  97. />
  98. </Container>
  99. </div>
  100. <div
  101. className="productShowcaseSection paddingTop"
  102. style={{ textAlign: "center" }} id="fast-download"
  103. >
  104. <h2>
  105. <a href={siteConfig.baseUrl + "docs/en/english-vectors.html"}>Download pre-trained models</a>
  106. </h2>
  107. <Container>
  108. <GridBlock
  109. align="center"
  110. contents={[
  111. {
  112. content: "Pre-trained on English webcrawl and Wikipedia",
  113. image: siteConfig.baseUrl + "img/model-blue.png" ,
  114. imageAlign: "top",
  115. title: "[English word vectors](" + siteConfig.baseUrl + "docs/en/english-vectors.html)",
  116. imageLink: siteConfig.baseUrl + "docs/en/english-vectors.html",
  117. pinned : "true",
  118. },
  119. {
  120. content: "Pre-trained models for 157 different languages",
  121. image: siteConfig.baseUrl + "img/model-red.png",
  122. imageAlign: "top",
  123. title: "[Multi-lingual word vectors](" + siteConfig.baseUrl + "docs/en/crawl-vectors.html)",
  124. imageLink: siteConfig.baseUrl + "docs/en/crawl-vectors.html",
  125. },
  126. ]}
  127. layout="twoColumn"
  128. />
  129. </Container>
  130. </div>
  131. <div
  132. className="productShowcaseSection paddingTop lightBackground"
  133. style={{ textAlign: "center" }} id="more-info"
  134. >
  135. <h2>
  136. <a href={siteConfig.baseUrl + "docs/en/support.html"}>Help and references</a>
  137. </h2>
  138. <Container>
  139. <GridBlock
  140. align="center"
  141. contents={[
  142. {
  143. content: "Learn how to use fastText",
  144. image: siteConfig.baseUrl + "img/fasttext-icon-tutorial.png",
  145. imageAlign: "top",
  146. title: "[Tutorials](" + siteConfig.baseUrl + "docs/en/supervised-tutorial.html)",
  147. imageLink: siteConfig.baseUrl + "docs/en/supervised-tutorial.html",
  148. },
  149. {
  150. content: "Questions gathered from the community",
  151. image: siteConfig.baseUrl + "img/fasttext-icon-faq.png",
  152. imageAlign: "top",
  153. title: "[Frequently Asked Questions](" + siteConfig.baseUrl + "docs/en/faqs.html)",
  154. imageLink: siteConfig.baseUrl + "docs/en/faqs.html"
  155. },
  156. {
  157. content: "In depth review of fastText commands",
  158. image: siteConfig.baseUrl + "img/fasttext-icon-api.png",
  159. imageAlign: "top",
  160. title: "[API](" + siteConfig.baseUrl + "docs/en/api.html)",
  161. imageLink: siteConfig.baseUrl + "docs/en/api.html",
  162. }
  163. ]}
  164. layout="threeColumn"
  165. />
  166. </Container>
  167. </div>
  168. <div className="productShowcaseSection paddingTop">
  169. <h2>
  170. <a href={siteConfig.baseUrl + "docs/en/references.html"}>References</a>
  171. </h2>
  172. <Container>
  173. <GridBlock
  174. align="left"
  175. contents={[
  176. {
  177. content: "P. Bojanowski, E. Grave, A. Joulin, T. Mikolov",
  178. title: "[Enriching Word Vectors with Subword Information](https://arxiv.org/abs/1607.04606)",
  179. },
  180. {
  181. content: "A. Joulin, E. Grave, P. Bojanowski, T. Mikolov",
  182. title: "[Bag of Tricks for Efficient Text Classification](https://arxiv.org/abs/1607.01759)",
  183. },
  184. {
  185. content: "A. Joulin, E. Grave, P. Bojanowski, M. Douze, H. Jegou, T. Mikolov",
  186. title: "[FastText.zip: Compressing text classification models](https://arxiv.org/abs/1612.03651)",
  187. }
  188. ]}
  189. layout="threeColumn"
  190. />
  191. </Container>
  192. </div>
  193. </div>
  194. </div>
  195. );
  196. }
  197. }
  198. /*
  199. <div
  200. className="productShowcaseSection paddingTop"
  201. style={{ textAlign: "center" }} id="more-info"
  202. >
  203. <h2>
  204. {"Applications"}
  205. </h2>
  206. <Container>
  207. <GridBlock
  208. align="center"
  209. contents={[
  210. {
  211. content: "Build a classifier for your usecase.",
  212. title: "Classification",
  213. },
  214. {
  215. content: "Build word vectors on top of your dataset.",
  216. title: "Word vectors",
  217. },
  218. {
  219. content: "Reduce memory footprint and save disk space.",
  220. title: "Quantization",
  221. }
  222. ]}
  223. layout="threeColumn"
  224. />
  225. </Container>
  226. <br/>
  227. <br/>
  228. </div>
  229. <div className="productShowcaseSection paddingTop">
  230. <h2>
  231. {"Users"}
  232. </h2>
  233. <div className="logos indexUsers">
  234. {showcase}
  235. </div>
  236. <br/>
  237. <br/>
  238. </div>
  239. <div className="productShowcaseSection paddingTop lightBackground">
  240. <h2>
  241. {"Authors"}
  242. </h2>
  243. <div className="logos">
  244. <a href="https://research.fb.com/people/bojanowski-piotr/">
  245. <img src="/img/authors/piotr_bojanowski.jpg" title="Piotr Bojanowski" />
  246. <br />
  247. Piotr Bojanowski
  248. </a>
  249. <a href="https://research.fb.com/people/grave-edouard/">
  250. <img src="/img/authors/edouard_grave.jpeg" title="Edouard Grave" />
  251. <br />
  252. Edouard Grave
  253. </a>
  254. <a href="https://research.fb.com/people/joulin-armand/">
  255. <img src="/img/authors/armand_joulin.jpg" title="Armand Joulin" />
  256. <br />
  257. Armand Joulin
  258. </a>
  259. <a href="https://research.fb.com/people/mikolov-tomas/">
  260. <img src="/img/authors/tomas_mikolov.jpg" title="Tomas Mikolov" />
  261. <br />
  262. Tomas Mikolov
  263. </a>
  264. <a href="https://research.fb.com/people/puhrsch-christian/">
  265. <img src="/img/authors/christian_puhrsch.png" title="Christian Puhrsch" />
  266. <br />
  267. Christian Puhrsch
  268. </a>
  269. </div>
  270. <br/>
  271. <br/>
  272. </div>
  273. */
  274. module.exports = Index;